From 635d11d74cd873e6f53d05b1d9f091ae112402a5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Apr 2012 16:48:03 +0200 Subject: Polymorphic inheritance support --- common/inheritance/driver.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'common/inheritance/driver.cxx') 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 query; + typedef odb::result result; + + transaction t (db->begin ()); + + result r (db->query (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) { -- cgit v1.1