aboutsummaryrefslogtreecommitdiff
path: root/evolution/soft-delete/model.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-16 10:17:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-17 12:04:03 +0200
commit24ea8fc0e06479e2c14b9ce78a95c138939c5204 (patch)
tree79d191191d107c5b47b33b8ef684ad4a9b138994 /evolution/soft-delete/model.hxx
parentb6ebd340651eaf347c86d3ba0dbed82c6cc8fb8d (diff)
Implement summary soft-deletion for composite value types
Diffstat (limited to 'evolution/soft-delete/model.hxx')
-rw-r--r--evolution/soft-delete/model.hxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx
index 0a81116..9c99abe 100644
--- a/evolution/soft-delete/model.hxx
+++ b/evolution/soft-delete/model.hxx
@@ -7,6 +7,7 @@
#endif
#include <string>
+#include <memory> // std::auto_ptr
#include <odb/core.hxx>
#include <odb/vector.hxx>
@@ -427,6 +428,36 @@ namespace MODEL_NAMESPACE(MODEL_VERSION)
#endif
}
+ // Test summarily deleted composite values.
+ //
+ #pragma db namespace table("t15_")
+ namespace test15
+ {
+ #pragma db value
+ struct value
+ {
+ std::string str;
+ odb::vector<int> vec;
+ };
+
+ #pragma db object
+ struct object
+ {
+ object (unsigned long id = 0): id_ (id) {}
+
+ #pragma db id
+ unsigned long id_;
+
+ std::auto_ptr<value> v;
+ unsigned long num;
+ };
+
+#if MODEL_VERSION == 3
+ #pragma db member(value::str) deleted(3)
+ #pragma db member(value::vec) deleted(3)
+#endif
+ }
+
// Test soft-deleted container member in a non-versioned object.
//
#pragma db namespace table("t21_")