From 0745f84e2d5c7133f6ee6608487089d69d7ad519 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/pgsql/database.hxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'odb/pgsql/database.hxx') 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::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 @@ -195,6 +201,14 @@ namespace odb void update (const typename object_traits::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 + void + update (const T& object, const section&); + // Make the object transient. Throw object_not_persistent if not // found. // -- cgit v1.1