diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-27 15:16:49 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-27 15:16:49 +0200 |
commit | 2f920671a7e4be7eb488724ae19360a87d66860c (patch) | |
tree | ba75343bc5e3daa6616658dfd158e83512ce4c19 /odb/mysql/statement-cache.hxx | |
parent | 16f68924f0704abba3598d261b4a4d74355179f1 (diff) |
Add support for persistent classes without object ids
New pragma id (object). New test: common/no-id.
Diffstat (limited to 'odb/mysql/statement-cache.hxx')
-rw-r--r-- | odb/mysql/statement-cache.hxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/odb/mysql/statement-cache.hxx b/odb/mysql/statement-cache.hxx index d5ede48..d1aad0a 100644 --- a/odb/mysql/statement-cache.hxx +++ b/odb/mysql/statement-cache.hxx @@ -38,16 +38,18 @@ namespace odb } template <typename T> - object_statements<T>& + typename object_statements_selector<T>::type& find_object () { + typedef typename object_statements_selector<T>::type object_statements; + map::iterator i (map_.find (&typeid (T))); if (i != map_.end ()) - return static_cast<object_statements<T>&> (*i->second); + return static_cast<object_statements&> (*i->second); - details::shared_ptr<object_statements<T> > p ( - new (details::shared) object_statements<T> (conn_)); + details::shared_ptr<object_statements> p ( + new (details::shared) object_statements (conn_)); map_.insert (map::value_type (&typeid (T), p)); return *p; |