From 3afd0ae312029464ccea86f112d2d65fb858029d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Nov 2014 13:54:29 +0200 Subject: Bulk update implementation --- odb/database.hxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'odb/database.hxx') diff --git a/odb/database.hxx b/odb/database.hxx index f4a3d36..0304d3c 100644 --- a/odb/database.hxx +++ b/odb/database.hxx @@ -78,7 +78,8 @@ namespace odb typename object_traits::id_type persist (const typename object_traits::pointer_type& obj_ptr); - // Bulk persist. + // Bulk persist. Can be a range of references or pointers (including + // smart pointers) to objects. // template void @@ -170,6 +171,13 @@ namespace odb void update (const typename object_traits::pointer_type& obj_ptr); + // Bulk update. Can be a range of references or pointers (including + // smart pointers) to objects. + // + template + void + update (I begin, I end); + // 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. @@ -219,6 +227,9 @@ namespace odb void erase (I id_begin, I id_end); + // Can be a range of references or pointers (including smart pointers) + // to objects. + // template void erase (I obj_begin, I obj_end); @@ -550,6 +561,10 @@ namespace odb void update_ (const typename object_traits::pointer_type&); + template + void + update_ (I, I); + template void update_ (const T&, const section&); -- cgit v1.1