From 91830e3bd38a05c73d03a5dfb88997799d44274b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 6 May 2013 12:05:39 +0200 Subject: 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. --- odb/database.hxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'odb/database.hxx') diff --git a/odb/database.hxx b/odb/database.hxx index 79fa622..6c70da7 100644 --- a/odb/database.hxx +++ b/odb/database.hxx @@ -83,6 +83,12 @@ namespace odb void load (const typename object_traits::id_type& id, T& object); + // Load (or reload, if it is already loaded) a section of an object. + // + template + void + load (T& object, section&); + // Reload an object. // template @@ -153,6 +159,14 @@ namespace odb void update (const typename object_traits::pointer_type& obj_ptr); + // Update a section of an object. Throws section_not_loaded exception + // if section is not loaded. Note also that this function does not + // clear the changed flag if it is set. + // + template + void + update (const T& object, const section&); + // Make the object transient. Throw object_not_persistent if not // found. // @@ -394,6 +408,10 @@ namespace odb template void + load_ (T&, section&); + + template + void reload_ (T&); template @@ -414,6 +432,10 @@ namespace odb template void + update_ (const T&, const section&); + + template + void erase_ (const typename object_traits::id_type&); template -- cgit v1.1