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/inheritance/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/inheritance/driver.cxx')
-rw-r--r-- | common/inheritance/driver.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index ce72863..0106b5b 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -143,7 +143,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); - assert (!db->query<base> (b_query::comp::num == 10).empty ()); + assert (!db->query<base> (b_query::comp.num == 10).empty ()); assert (!db->query<object1> (o1_query::num1 == 21).empty ()); assert (!db->query<object2> (o2_query::num == 2).empty ()); @@ -155,7 +155,7 @@ main (int argc, char* argv[]) // Query condition with referenced composite member in base class. // { - r_result r (db->query<reference> (r_query::o1::comp::num == 11)); + r_result r (db->query<reference> (r_query::o1->comp.num == 11)); assert (!r.empty ()); delete r.begin ()->o1_; } |