aboutsummaryrefslogtreecommitdiff
path: root/common/composite-id/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/composite-id/driver.cxx')
-rw-r--r--common/composite-id/driver.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/common/composite-id/driver.cxx b/common/composite-id/driver.cxx
index 86d13b0..f8773d5 100644
--- a/common/composite-id/driver.cxx
+++ b/common/composite-id/driver.cxx
@@ -695,6 +695,32 @@ main (int argc, char* argv[])
assert (p3->o1[1] == 0);
}
}
+
+ // Test 9.
+ {
+ using namespace test9;
+
+ object o (123, "abc");
+ o.v.push_back (123);
+
+ // persist
+ //
+ {
+ transaction t (db->begin ());
+ db->persist (o);
+ t.commit ();
+ }
+
+ // load & check
+ //
+ {
+ transaction t (db->begin ());
+ result<object> r (db->query<object> ());
+ result<object>::iterator i (r.begin ());
+ assert (i != r.end () && o == *i && ++i == r.end ());
+ t.commit ();
+ }
+ }
}
catch (const odb::exception& e)
{