diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-06 12:05:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-14 15:19:13 +0200 |
commit | 0745f84e2d5c7133f6ee6608487089d69d7ad519 (patch) | |
tree | bcba1aee153c18ef58396c86632de35360fb5950 /odb/pgsql/database.hxx | |
parent | 79ccdd960976729e2d46e2d476f54b92c5348a5f (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/pgsql/database.hxx')
-rw-r--r-- | odb/pgsql/database.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/odb/pgsql/database.hxx b/odb/pgsql/database.hxx index 1b456fb..2a70e96 100644 --- a/odb/pgsql/database.hxx +++ b/odb/pgsql/database.hxx @@ -125,6 +125,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> @@ -195,6 +201,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. // |