From 1feaef1c1e2c8daba97b20e1fb012706c6adf1ce Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 22 Aug 2011 11:47:55 +0200 Subject: Add database::erase_query() function New test: common/erase-query. Documentation is in Section 3.9, "Deleting Persistent Objects". The current implementation does not work well with the session (no removal of the erased objects from the cache). --- odb/database.hxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'odb/database.hxx') diff --git a/odb/database.hxx b/odb/database.hxx index c4458d9..2e6c79d 100644 --- a/odb/database.hxx +++ b/odb/database.hxx @@ -125,6 +125,24 @@ namespace odb void erase (const typename object_traits::pointer_type& obj_ptr); + // Erase multiple objects matching a query predicate. + // + template + unsigned long long + erase_query (); + + template + unsigned long long + erase_query (const char*); + + template + unsigned long long + erase_query (const std::string&); + + template + unsigned long long + erase_query (const odb::query::object_type>&); + // Query API. // template -- cgit v1.1