diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-23 16:48:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-23 16:48:03 +0200 |
commit | 635d11d74cd873e6f53d05b1d9f091ae112402a5 (patch) | |
tree | 49a9b835aecba11ff666a7d5c34fd1a248881e78 /common/inheritance/driver.cxx | |
parent | adfa9c5ffccdd4e5db8c545d9106c0eb1d7bdcb8 (diff) |
Polymorphic inheritance support
Diffstat (limited to 'common/inheritance/driver.cxx')
-rw-r--r-- | common/inheritance/driver.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common/inheritance/driver.cxx b/common/inheritance/driver.cxx index a0e3725..466ed33 100644 --- a/common/inheritance/driver.cxx +++ b/common/inheritance/driver.cxx @@ -161,6 +161,23 @@ main (int argc, char* argv[]) t.commit (); } + + // views + // + { + typedef odb::query<object2_view> query; + typedef odb::result<object2_view> result; + + transaction t (db->begin ()); + + result r (db->query<object2_view> (query::num == o2.num_)); + result::iterator i (r.begin ()); + assert (i != r.end () && + i->num == o2.num_ && i->id == o2.id_ && i->str == o2.str_); + assert (++i == r.end ()); + + t.commit (); + } } catch (const odb::exception& e) { |