diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-10 14:10:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-10 14:10:45 +0200 |
commit | a3372ca4e3eb1ba4e87dfa9ccb0c78c379935441 (patch) | |
tree | fda49b86acd9c9f79d0ea7bd9262ed6f5a41803e /odb/oracle/simple-object-statements.txx | |
parent | 1d287936950aa96a7b4a12b0d05633f257ab2c90 (diff) |
Schema versioning support
Diffstat (limited to 'odb/oracle/simple-object-statements.txx')
-rw-r--r-- | odb/oracle/simple-object-statements.txx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/odb/oracle/simple-object-statements.txx b/odb/oracle/simple-object-statements.txx index 6723b1c..61bbc5f 100644 --- a/odb/oracle/simple-object-statements.txx +++ b/odb/oracle/simple-object-statements.txx @@ -8,6 +8,7 @@ #include <odb/exceptions.hxx> #include <odb/oracle/connection.hxx> +#include <odb/oracle/traits-calls.hxx> namespace odb { @@ -67,8 +68,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 ()); @@ -83,7 +85,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); @@ -92,12 +96,15 @@ 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); + tc.init (*l.obj, image (), &db); find_->stream_result (); - object_traits::load_ (*this, *l.obj); // Load containers, etc. + + // 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 @@ -113,7 +120,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 (); |