aboutsummaryrefslogtreecommitdiff
path: root/mapping/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-25 13:08:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-25 13:08:16 +0200
commit0bea9feb8e97b0257b801f34322db72a01373468 (patch)
treea0c94755ea3a8d5d24782f099158b02e96edb4e1 /mapping/driver.cxx
parentec564b14a5f4558d34578a1e10129f910539fa49 (diff)
Cosmetic changes
Diffstat (limited to 'mapping/driver.cxx')
-rw-r--r--mapping/driver.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/mapping/driver.cxx b/mapping/driver.cxx
index 80f825e..2d8315f 100644
--- a/mapping/driver.cxx
+++ b/mapping/driver.cxx
@@ -23,10 +23,12 @@ main (int argc, char* argv[])
{
auto_ptr<database> db (create_database (argc, argv));
+ // Create a few persistent person objects.
+ //
{
person john ("John", "Doe", date (1978, 10, 13), true);
- person jane ("Jane", "Doe", date (1975, 11, 23), false);
- person joe ("Joe", "Dirt", date (1973, 12, 28), true);
+ person jane ("Jane", "Doe", date (1975, 9, 23), false);
+ person joe ("Joe", "Dirt", date (1973, 12, 3), true);
transaction t (db->begin ());
@@ -37,6 +39,8 @@ main (int argc, char* argv[])
t.commit ();
}
+ // Query for a person using data members of our custom-mapped types.
+ //
{
typedef odb::query<person> query;
typedef odb::result<person> result;
@@ -48,7 +52,7 @@ main (int argc, char* argv[])
for (result::iterator i (r.begin ()); i != r.end (); ++i)
{
- cout << i->first () << " " << i->last () << endl;
+ cout << i->first () << " " << i->last () << " " << i->born () << endl;
}
t.commit ();