From a3372ca4e3eb1ba4e87dfa9ccb0c78c379935441 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Sep 2013 14:10:45 +0200 Subject: Schema versioning support --- odb/oracle/simple-object-statements.txx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'odb/oracle/simple-object-statements.txx') 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 #include +#include namespace odb { @@ -67,8 +68,9 @@ namespace odb } template + template void object_statements:: - 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 tc (svm); + + if (!tc.find_ (static_cast (*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 (*this), *l.obj, false); if (!delayed_.empty ()) - load_delayed_ (); + load_delayed_ (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 (); -- cgit v1.1