From 239c24da194d98e0823642d408d35fc8fe3e7ae9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Aug 2014 09:37:06 +0200 Subject: Implement bulk database operation support for Oracle and SQL Server --- odb/mssql/database.hxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'odb/mssql/database.hxx') diff --git a/odb/mssql/database.hxx b/odb/mssql/database.hxx index 4ac85d2..fc13974 100644 --- a/odb/mssql/database.hxx +++ b/odb/mssql/database.hxx @@ -153,6 +153,10 @@ namespace odb template typename object_traits::id_type + persist (const T& object); + + template + typename object_traits::id_type persist (T* obj_ptr); template class P> @@ -175,6 +179,13 @@ namespace odb typename object_traits::id_type persist (const typename object_traits::pointer_type& obj_ptr); + // Bulk persist. Can be a range of references or pointers (including + // smart pointers) to objects. + // + template + void + persist (I begin, I end, bool continue_failed = true); + // Load an object. Throw object_not_persistent if not found. // template @@ -261,6 +272,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, bool continue_failed = true); + // 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. @@ -304,6 +322,19 @@ namespace odb void erase (const typename object_traits::pointer_type& obj_ptr); + // Bulk erase. + // + template + void + erase (I id_begin, I id_end, bool continue_failed = true); + + // Can be a range of references or pointers (including smart pointers) + // to objects. + // + template + void + erase (I obj_begin, I obj_end, bool continue_failed = true); + // Erase multiple objects matching a query predicate. // template -- cgit v1.1