aboutsummaryrefslogtreecommitdiff
path: root/common/query/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-04-23 16:48:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-04-23 16:48:03 +0200
commit635d11d74cd873e6f53d05b1d9f091ae112402a5 (patch)
tree49a9b835aecba11ff666a7d5c34fd1a248881e78 /common/query/driver.cxx
parentadfa9c5ffccdd4e5db8c545d9106c0eb1d7bdcb8 (diff)
Polymorphic inheritance support
Diffstat (limited to 'common/query/driver.cxx')
-rw-r--r--common/query/driver.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx
index c207955..cc92f41 100644
--- a/common/query/driver.cxx
+++ b/common/query/driver.cxx
@@ -421,7 +421,15 @@ main (int argc, char* argv[])
++i;
assert (i != r.end ());
- auto_ptr<person> joe (db->load<person> (3));
+ {
+ auto_ptr<person> joe (db->load<person> (3));
+ }
+
+ {
+ person p (5, "Peter", "Peterson", 70, false, key3);
+ db->persist (p);
+ db->erase (p);
+ }
// SQL Server does not support re-loading of an object with long data
// from a query result.
@@ -430,8 +438,10 @@ main (int argc, char* argv[])
assert (i->last_name_ == "Doe"); // Actual load.
#endif
+ // Overwrite object image again.
+ //
+ auto_ptr<person> joe (db->load<person> (3));
person p;
- joe.reset (db->load<person> (3)); // Overwrite object image again.
i.load (p);
assert (p.last_name_ == "Doe");