From 1f2834e458c4c28fe3264968a80f451636c232e4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 22 Feb 2012 12:28:06 +0200 Subject: Add support for composite object ids New pragma id_type (member). New test: common/composite-id. The composite example has also been updated. --- composite/driver.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'composite/driver.cxx') 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 ()); -- cgit v1.1