aboutsummaryrefslogtreecommitdiff
path: root/odb/polymorphic-map.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/polymorphic-map.hxx')
-rw-r--r--odb/polymorphic-map.hxx34
1 files changed, 33 insertions, 1 deletions
diff --git a/odb/polymorphic-map.hxx b/odb/polymorphic-map.hxx
index 5c3e434..3c0883f 100644
--- a/odb/polymorphic-map.hxx
+++ b/odb/polymorphic-map.hxx
@@ -149,7 +149,8 @@ namespace odb
};
template <typename T, database_id DB>
- bool dispatch_impl (
+ bool
+ dispatch_impl (
typename polymorphic_concrete_info<
typename object_traits<T>::root_type>::call_type c,
database& db,
@@ -235,6 +236,37 @@ namespace odb
return r;
}
+
+ template <typename T, database_id DB, typename ST>
+ void
+ section_load_impl (odb::connection& conn,
+ typename object_traits<T>::root_type& obj,
+ bool top)
+ {
+ typedef object_traits_impl<T, DB> derived_traits;
+ typedef typename derived_traits::statements_type statements_type;
+ typedef typename statements_type::connection_type connection_type;
+
+ connection_type& c (static_cast<connection_type&> (conn));
+ statements_type& sts (c.statement_cache ().template find_object<T> ());
+
+ ST::load (sts.extra_statement_cache (), static_cast<T&> (obj), top);
+ }
+
+ template <typename T, database_id DB, typename ST>
+ void
+ section_update_impl (odb::connection& conn,
+ const typename object_traits<T>::root_type& obj)
+ {
+ typedef object_traits_impl<T, DB> derived_traits;
+ typedef typename derived_traits::statements_type statements_type;
+ typedef typename statements_type::connection_type connection_type;
+
+ connection_type& c (static_cast<connection_type&> (conn));
+ statements_type& sts (c.statement_cache ().template find_object<T> ());
+
+ ST::update (sts.extra_statement_cache (), static_cast<const T&> (obj));
+ }
}
#include <odb/polymorphic-map.ixx>