diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-10 14:10:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-17 12:04:01 +0200 |
commit | 31fd2870497686667f20b2d43467a07482f8ab40 (patch) | |
tree | 9e8fc08cd23b52699c62149f665f32df8892c7c1 /odb/sqlite/simple-object-statements.txx | |
parent | c3248cd60418cee935508f62a3436970f9d234b2 (diff) |
Schema versioning support
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 (); |