diff options
Diffstat (limited to 'odb/sqlite/simple-object-statements.txx')
-rw-r--r-- | odb/sqlite/simple-object-statements.txx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/odb/sqlite/simple-object-statements.txx b/odb/sqlite/simple-object-statements.txx index 15689c6..552806c 100644 --- a/odb/sqlite/simple-object-statements.txx +++ b/odb/sqlite/simple-object-statements.txx @@ -8,6 +8,7 @@ #include <odb/exceptions.hxx> #include <odb/sqlite/connection.hxx> +#include <odb/sqlite/traits-calls.hxx> namespace odb { @@ -70,8 +71,9 @@ namespace odb } template <typename T> + template <typename STS> void object_statements<T>:: - load_delayed_ () + load_delayed_ (const schema_version_migration* svm) { database& db (connection ().database ()); @@ -86,7 +88,9 @@ namespace odb if (l.loader == 0) { - if (!object_traits::find_ (*this, &l.id)) + object_traits_calls<T> tc (svm); + + if (!tc.find_ (static_cast<STS&> (*this), &l.id)) throw object_not_persistent (); object_traits::callback (db, *l.obj, callback_event::pre_load); @@ -95,11 +99,14 @@ namespace odb // loads being added to the delayed_ vector. We need to process // those before we call the post callback. // - object_traits::init (*l.obj, image (), &db); - object_traits::load_ (*this, *l.obj); // Load containers, etc. + tc.init (*l.obj, image (), &db); + + // Load containers, etc. + // + tc.load_ (static_cast<STS&> (*this), *l.obj, false); if (!delayed_.empty ()) - load_delayed_ (); + load_delayed_<STS> (svm); // Temporarily unlock the statement for the post_load call so that // it can load objects of this type recursively. This is safe to do @@ -115,7 +122,7 @@ namespace odb } } else - l.loader (db, l.id, *l.obj); + l.loader (db, l.id, *l.obj, svm); pointer_cache_traits::load (ig.position ()); ig.release (); |