diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-23 16:48:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-23 16:48:03 +0200 |
commit | 635d11d74cd873e6f53d05b1d9f091ae112402a5 (patch) | |
tree | 49a9b835aecba11ff666a7d5c34fd1a248881e78 /common/query | |
parent | adfa9c5ffccdd4e5db8c545d9106c0eb1d7bdcb8 (diff) |
Polymorphic inheritance support
Diffstat (limited to 'common/query')
-rw-r--r-- | common/query/driver.cxx | 14 |
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"); |