aboutsummaryrefslogtreecommitdiff
path: root/qt
diff options
context:
space:
mode:
Diffstat (limited to 'qt')
-rw-r--r--qt/oracle/date-time/driver.cxx47
1 files changed, 21 insertions, 26 deletions
diff --git a/qt/oracle/date-time/driver.cxx b/qt/oracle/date-time/driver.cxx
index 2d9b46d..f6c5400 100644
--- a/qt/oracle/date-time/driver.cxx
+++ b/qt/oracle/date-time/driver.cxx
@@ -51,32 +51,27 @@ main (int argc, char* argv[])
assert (ol->is_null ());
}
- // // Check persistence of valid dates and times.
- // //
- // QDateTime t (QDateTime::currentDateTime ());
-
- // t.setTime (QTime (t.time ().hour (),
- // t.time ().minute (),
- // t.time ().second (),
- // t.time ().msec ()));
-
- // o.date = t.date ();
- // o.date_time = t;
- // o.time = t.time ();
-
- // {
- // transaction t (db->begin ());
- // db->persist (o);
- // t.commit ();
- // }
-
- // {
- // transaction t (db->begin ());
- // auto_ptr<object> ol (db->load<object> (o.id));
- // t.commit ();
-
- // assert (*ol == o);
- // }
+ // Check persistence of valid dates and times.
+ //
+ QDateTime t (QDateTime::currentDateTime ());
+
+ o.date = t.date ();
+ o.date_time = t;
+ o.time = t.time ();
+
+ {
+ transaction t (db->begin ());
+ db->persist (o);
+ t.commit ();
+ }
+
+ {
+ transaction t (db->begin ());
+ auto_ptr<object> ol (db->load<object> (o.id));
+ t.commit ();
+
+ assert (*ol == o);
+ }
}
catch (const odb::exception& e)
{