diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-14 15:16:09 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-14 15:16:09 +0200 |
commit | 075f64ca84e4e1be22bad30e4974e9b675d12ec8 (patch) | |
tree | ec157ade131adf217d9c2dcd47228bc8c7b53cb9 /odb/mysql/database.hxx | |
parent | 7f55357c16a981ae2d2d4b1ea2d1cfdcff1bdf74 (diff) |
Add support for object sections
Sections are an optimization mechanism that allows the partitioning of
data members of a persistent class into groups that can be separately
loaded and/or updated.
Diffstat (limited to 'odb/mysql/database.hxx')
-rw-r--r-- | odb/mysql/database.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/odb/mysql/database.hxx b/odb/mysql/database.hxx index 8053bee..af4fcfe 100644 --- a/odb/mysql/database.hxx +++ b/odb/mysql/database.hxx @@ -212,6 +212,12 @@ namespace odb void load (const typename object_traits<T>::id_type& id, T& object); + // Load (or reload, if it is already loaded) a section of an object. + // + template <typename T> + void + load (T& object, section&); + // Reload an object. // template <typename T> @@ -282,6 +288,14 @@ namespace odb void update (const typename object_traits<T>::pointer_type& obj_ptr); + // Update a section of an object. Throws the section_not_loaded + // exception if the section is not loaded. Note also that this + // function does not clear the changed flag if it is set. + // + template <typename T> + void + update (const T& object, const section&); + // Make the object transient. Throw object_not_persistent if not // found. // |