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 | d83a7296e228cf0af74992020f51c566a03108c9 (patch) | |
tree | ab48b74c739049163839e4334e3855ad19906cb3 /odb/sqlite/statement-cache.hxx | |
parent | 2e8daa4a5880f47e547de7db4e7ff5074d365723 (diff) |
Add support for persistent classes without object ids
New pragma id (object). New test: common/no-id.
Diffstat (limited to 'odb/sqlite/statement-cache.hxx')
-rw-r--r-- | odb/sqlite/statement-cache.hxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/odb/sqlite/statement-cache.hxx b/odb/sqlite/statement-cache.hxx index 16e0c15..1bdefb6 100644 --- a/odb/sqlite/statement-cache.hxx +++ b/odb/sqlite/statement-cache.hxx @@ -72,16 +72,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; |