diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-20 11:53:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-20 11:53:04 +0200 |
commit | 18a040773c389de7be48111efc0f3cf7252ffc68 (patch) | |
tree | e68e5edde6a7f321e03172ecd5684d26644978c9 /common/erase-query/driver.cxx | |
parent | f70b64e2c4f9861d7013492b609212ed78e840f5 (diff) |
Change query syntax to use . for composite and -> for object pointer access
Also make non-inverse query columns act as both an object pointer and a
normal column. The latter allows us to use natural expressions such as
query<employee>::employer.is_null ().
Diffstat (limited to 'common/erase-query/driver.cxx')
-rw-r--r-- | common/erase-query/driver.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index 2137377..5085207 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -112,6 +112,31 @@ main (int argc, char* argv[]) } */ + // For now we can only do column-based tests, like is_null(). + // + { + object o11 (1); + object o12 (2); + object o13 (3); + object2 o2; + + o12.o2 = &o2; + + transaction t (db->begin ()); + db->persist (o2); + db->persist (o13); + db->persist (o12); + db->persist (o11); + t.commit (); + } + + { + transaction t (db->begin ()); + assert (db->erase_query<object> (query::o2.is_null ()) == 2); + db->erase_query<object> (); + t.commit (); + } + // Make sure container data is deleted. // { |