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 | 0ed9ceef3abbd9f4ff786f6a02fe8767780e8c2c (patch) | |
tree | 0bca6f9e302dd92eb4dc9136ab0b826f8fa61aff /odb/mysql/polymorphic-object-statements.txx | |
parent | 075f64ca84e4e1be22bad30e4974e9b675d12ec8 (diff) |
Schema versioning support
Diffstat (limited to 'odb/mysql/polymorphic-object-statements.txx')
-rw-r--r-- | odb/mysql/polymorphic-object-statements.txx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/odb/mysql/polymorphic-object-statements.txx b/odb/mysql/polymorphic-object-statements.txx index d8a7a1d..a228b72 100644 --- a/odb/mysql/polymorphic-object-statements.txx +++ b/odb/mysql/polymorphic-object-statements.txx @@ -10,6 +10,7 @@ #include <odb/mysql/connection.hxx> #include <odb/mysql/transaction.hxx> #include <odb/mysql/statement-cache.hxx> +#include <odb/mysql/traits-calls.hxx> namespace odb { @@ -111,7 +112,10 @@ namespace odb template <typename T> void polymorphic_derived_object_statements<T>:: - delayed_loader (odb::database& db, const id_type& id, root_type& robj) + delayed_loader (odb::database& db, + const id_type& id, + root_type& robj, + const schema_version_migration* svm) { connection_type& conn (transaction::current ().connection ()); polymorphic_derived_object_statements& sts ( @@ -122,14 +126,16 @@ namespace odb // The same code as in object_statements::load_delayed_(). // - if (!object_traits::find_ (sts, &id)) + object_traits_calls<T> tc (svm); + + if (!tc.find_ (sts, &id)) throw object_not_persistent (); object_traits::callback (db, obj, callback_event::pre_load); - object_traits::init (obj, sts.image (), &db); - object_traits::load_ (sts, obj); // Load containers, etc. + tc.init (obj, sts.image (), &db); + tc.load_ (sts, obj, false); // Load containers, etc. - rsts.load_delayed (); + rsts.load_delayed (svm); { typename root_statements_type::auto_unlock u (rsts); |