aboutsummaryrefslogtreecommitdiff
path: root/composite/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-02-22 12:28:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-02-22 12:28:06 +0200
commit1f2834e458c4c28fe3264968a80f451636c232e4 (patch)
treeca5d05879fd3fb24afca9b2f2780955a114ce501 /composite/driver.cxx
parent8a17d4e73d956ba6d95ffb685760d821bf185a3c (diff)
Add support for composite object ids
New pragma id_type (member). New test: common/composite-id. The composite example has also been updated.
Diffstat (limited to 'composite/driver.cxx')
-rw-r--r--composite/driver.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/composite/driver.cxx b/composite/driver.cxx
index cb77acd..aaedf17 100644
--- a/composite/driver.cxx
+++ b/composite/driver.cxx
@@ -24,9 +24,13 @@ main (int argc, char* argv[])
// Create a person object.
//
- unsigned int id;
+ email_address id;
{
- person p ("Joe", "Dirt", "Mr", phone_numbers ("555 5555", "666 6666"));
+ person p ("joe@example.com",
+ "Joe",
+ "Dirt",
+ "Mr",
+ phone_numbers ("555 5555", "666 6666"));
transaction t (db->begin ());
id = db->persist (p);
@@ -57,7 +61,8 @@ main (int argc, char* argv[])
name& n (joe->name ());
- cout << n.title () << " " << n.first () << " " << n.last () << endl;
+ cout << n.title () << " " << n.first () << " " << n.last () << " "
+ << '<' << joe->email ().address () << '>' << endl;
name_extras& ne (n.extras ());