aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/polymorphic-object-statements.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-10 14:10:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-17 12:04:01 +0200
commit31fd2870497686667f20b2d43467a07482f8ab40 (patch)
tree9e8fc08cd23b52699c62149f665f32df8892c7c1 /odb/sqlite/polymorphic-object-statements.txx
parentc3248cd60418cee935508f62a3436970f9d234b2 (diff)
Schema versioning support
Diffstat (limited to 'odb/sqlite/polymorphic-object-statements.txx')
-rw-r--r--odb/sqlite/polymorphic-object-statements.txx16
1 files changed, 11 insertions, 5 deletions
diff --git a/odb/sqlite/polymorphic-object-statements.txx b/odb/sqlite/polymorphic-object-statements.txx
index 999eb3e..b97cd14 100644
--- a/odb/sqlite/polymorphic-object-statements.txx
+++ b/odb/sqlite/polymorphic-object-statements.txx
@@ -10,6 +10,7 @@
#include <odb/sqlite/connection.hxx>
#include <odb/sqlite/transaction.hxx>
#include <odb/sqlite/statement-cache.hxx>
+#include <odb/sqlite/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);