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/readonly/driver.cxx | |
parent | adfa9c5ffccdd4e5db8c545d9106c0eb1d7bdcb8 (diff) |
Polymorphic inheritance support
Diffstat (limited to 'common/readonly/driver.cxx')
-rw-r--r-- | common/readonly/driver.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/common/readonly/driver.cxx b/common/readonly/driver.cxx index c543f7a..b39ab38 100644 --- a/common/readonly/driver.cxx +++ b/common/readonly/driver.cxx @@ -204,15 +204,20 @@ main (int argc, char* argv[]) // Readonly object. // { + typedef odb::object_traits<simple_object> so_traits; typedef odb::object_traits<ro_object> ro_traits; typedef odb::object_traits<rw_object> rw_traits; + assert (so_traits::column_count == + so_traits::id_column_count + so_traits::readonly_column_count); + assert (ro_traits::column_count == ro_traits::id_column_count + ro_traits::readonly_column_count); assert (rw_traits::column_count != rw_traits::id_column_count + rw_traits::readonly_column_count); + simple_object so (1, 1); ro_object ro_o (1, 1); rw_object rw_o (1, 1); @@ -224,6 +229,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); + db->persist (so); db->persist (ro_o); db->persist (rw_o); t.commit (); @@ -234,6 +240,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); + //db->update (so); // Compile error. //db->update (ro_o); // Compile error. db->update (rw_o); t.commit (); @@ -241,8 +248,9 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); - db->load<ro_object> (1, ro_o); - db->load<ro_object> (1, rw_o); + db->load (1, so); + db->load (1, ro_o); + db->load (1, rw_o); t.commit (); } |