aboutsummaryrefslogtreecommitdiff
path: root/common/readonly/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/readonly/driver.cxx')
-rw-r--r--common/readonly/driver.cxx12
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 ();
}