aboutsummaryrefslogtreecommitdiff
path: root/evolution/soft-delete/model.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-09-05 13:02:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-09-17 12:04:03 +0200
commit2c3dcfeee4fd2adb5a7dbd9af1c8ee02d4664d39 (patch)
tree9a714ac0b54c126d525fe89d52414fbe234af263 /evolution/soft-delete/model.hxx
parent59293cddb0d37a2bf37e579aa42da00fc9cfc5dc (diff)
Versioned section support
Diffstat (limited to 'evolution/soft-delete/model.hxx')
-rw-r--r--evolution/soft-delete/model.hxx91
1 files changed, 91 insertions, 0 deletions
diff --git a/evolution/soft-delete/model.hxx b/evolution/soft-delete/model.hxx
index 6abdd39..5defcac 100644
--- a/evolution/soft-delete/model.hxx
+++ b/evolution/soft-delete/model.hxx
@@ -10,6 +10,7 @@
#include <odb/core.hxx>
#include <odb/vector.hxx>
+#include <odb/section.hxx>
#include <common/config.hxx> // DATABASE_XXX
@@ -178,6 +179,68 @@ namespace MODEL_NAMESPACE(MODEL_VERSION)
#endif
}
+ // Test soft-deleted section member.
+ //
+ #pragma db namespace table("t7_")
+ namespace test7
+ {
+ #pragma db object
+ struct object
+ {
+ object (unsigned long id = 0): id_ (id) {}
+
+ #pragma db id
+ unsigned long id_;
+
+ #pragma db load(lazy) update(change)
+ odb::section s;
+
+ #pragma db section(s)
+ std::string str;
+
+ unsigned long num;
+
+ #pragma db section(s)
+ odb::vector<int> vec;
+ };
+
+#if MODEL_VERSION == 3
+ #pragma db member(object::s) deleted(3)
+#endif
+ }
+
+ // Test soft-deleted members of a section.
+ //
+ #pragma db namespace table("t8_")
+ namespace test8
+ {
+ #pragma db object
+ struct object
+ {
+ object (unsigned long id = 0): id_ (id) {}
+
+ #pragma db id
+ unsigned long id_;
+
+ #pragma db load(lazy) update(change)
+ odb::section s;
+
+ #pragma db section(s)
+ std::string str;
+
+ #pragma db section(s)
+ unsigned long num;
+
+ #pragma db section(s)
+ odb::vector<int> vec;
+ };
+
+#if MODEL_VERSION == 3
+ #pragma db member(object::str) deleted(3)
+ #pragma db member(object::vec) deleted(3)
+#endif
+ }
+
#endif // DATABASE_SQLITE
// Test soft-deleted container member in a non-versioned object.
@@ -201,6 +264,34 @@ namespace MODEL_NAMESPACE(MODEL_VERSION)
#pragma db member(object::vec) deleted(3)
#endif
}
+
+ // Test soft-deleted container member in a non-versioned section.
+ //
+ #pragma db namespace table("t22_")
+ namespace test22
+ {
+ #pragma db object
+ struct object
+ {
+ object (unsigned long id = 0): id_ (id) {}
+
+ #pragma db id
+ unsigned long id_;
+
+ #pragma db load(lazy) update(change)
+ odb::section s;
+
+ #pragma db section(s)
+ unsigned long num;
+
+ #pragma db section(s)
+ odb::vector<int> vec;
+ };
+
+#if MODEL_VERSION == 3
+ #pragma db member(object::vec) deleted(3)
+#endif
+ }
}
#undef MODEL_NAMESPACE