aboutsummaryrefslogtreecommitdiff
path: root/common/relationship/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/relationship/driver.cxx')
-rw-r--r--common/relationship/driver.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx
index 9266e2b..f7aa79e 100644
--- a/common/relationship/driver.cxx
+++ b/common/relationship/driver.cxx
@@ -96,6 +96,21 @@ main (int argc, char* argv[])
assert (*a1 == a);
}
+ // query
+ //
+ typedef odb::query<aggr> query;
+ typedef odb::result<aggr> result;
+
+ {
+ transaction t (db->begin ());
+
+ result r (db->query<aggr> (query::o1::str == "obj1"));
+ assert (r.size () == 1);
+ assert (r.begin ()->o1->id == a.o1->id);
+
+ t.commit ();
+ }
+
// test NULL pointer
//
delete a.o1;