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.hxx | |
parent | 075f64ca84e4e1be22bad30e4974e9b675d12ec8 (diff) |
Schema versioning support
Diffstat (limited to 'odb/mysql/polymorphic-object-statements.hxx')
-rw-r--r-- | odb/mysql/polymorphic-object-statements.hxx | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/odb/mysql/polymorphic-object-statements.hxx b/odb/mysql/polymorphic-object-statements.hxx index 71b3d93..63662df 100644 --- a/odb/mysql/polymorphic-object-statements.hxx +++ b/odb/mysql/polymorphic-object-statements.hxx @@ -104,6 +104,8 @@ namespace odb new (details::shared) select_statement_type ( this->conn_, object_traits::find_discriminator_statement, + false, // Doesn't need to be processed. + false, // Don't optimize. discriminator_id_image_binding_, discriminator_image_binding_, false)); @@ -117,6 +119,18 @@ namespace odb virtual ~polymorphic_root_object_statements (); + // Static "override" (statements type). + // + void + load_delayed (const schema_version_migration* svm) + { + assert (this->locked ()); + + if (!this->delayed_.empty ()) + this->template load_delayed_<polymorphic_root_object_statements> ( + svm); + } + public: static const std::size_t id_column_count = object_statements<T>::id_column_count; @@ -190,7 +204,10 @@ namespace odb // Delayed loading. // static void - delayed_loader (odb::database&, const id_type&, root_type&); + delayed_loader (odb::database&, + const id_type&, + root_type&, + const schema_version_migration*); public: // Root and immediate base statements. @@ -295,6 +312,7 @@ namespace odb new (details::shared) insert_statement_type ( conn_, object_traits::persist_statement, + object_traits::versioned, // Process if versioned. insert_image_binding_, false)); @@ -312,6 +330,8 @@ namespace odb new (details::shared) select_statement_type ( conn_, object_traits::find_statements[i], + object_traits::versioned, // Process if versioned. + false, // Don't optimize. root_statements_.id_image_binding (), select_image_bindings_[i], false)); @@ -327,6 +347,7 @@ namespace odb new (details::shared) update_statement_type ( conn_, object_traits::update_statement, + object_traits::versioned, // Process if versioned. update_image_binding_, false)); |