diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-22 11:47:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-22 11:47:55 +0200 |
commit | 1feaef1c1e2c8daba97b20e1fb012706c6adf1ce (patch) | |
tree | a3c7f577e7019a14e45990d50a8b0da1c294e9e4 /odb/database.hxx | |
parent | 5b6649e6f7dd256147b48197a007c23001cef647 (diff) |
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).
Diffstat (limited to 'odb/database.hxx')
-rw-r--r-- | odb/database.hxx | 18 |
1 files changed, 18 insertions, 0 deletions
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<T>::pointer_type& obj_ptr); + // Erase multiple objects matching a query predicate. + // + template <typename T> + unsigned long long + erase_query (); + + template <typename T> + unsigned long long + erase_query (const char*); + + template <typename T> + unsigned long long + erase_query (const std::string&); + + template <typename T> + unsigned long long + erase_query (const odb::query<typename object_traits<T>::object_type>&); + // Query API. // template <typename T> |