diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-16 10:57:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-16 10:57:32 +0200 |
commit | c4b6357a9908fb05261efa8764e5c8a6d8727b96 (patch) | |
tree | f08c518af05721cbee7f3738e66d97b905f02e87 /odb/context.hxx | |
parent | 09d7377f81aeb8fde4aa1698e946457f03380d45 (diff) |
Implement soft delete for persistent classes
Diffstat (limited to 'odb/context.hxx')
-rw-r--r-- | odb/context.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/odb/context.hxx b/odb/context.hxx index 862b74e..11a6713 100644 --- a/odb/context.hxx +++ b/odb/context.hxx @@ -726,6 +726,20 @@ public: return m.count ("transient"); } + // Return the deletion version or 0 if not deleted. + // + static unsigned long long + deleted (semantics::class_& c) + { + return c.get<unsigned long long> ("deleted", 0); + } + + static unsigned long long + deleted (semantics::data_member& m) + { + return m.get<unsigned long long> ("deleted", 0); + } + static bool id (semantics::data_member& m) { |