From 3506ef645e4cd26aebb73f493001d584e4cce22a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 26 Apr 2012 11:29:05 +0200 Subject: Make session optional --- schema/custom/README | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'schema/custom/README') diff --git a/schema/custom/README b/schema/custom/README index 373169f..77febef 100644 --- a/schema/custom/README +++ b/schema/custom/README @@ -2,7 +2,7 @@ This example shows how to map persistent C++ classes to a custom database schema. In particular, it shows how to map all the commonly-used constructs, including containers, object relationships, and composite value types. -The example uses the shared_ptr smart pointer from TR1 and requires a C++ +The example uses the shared_ptr smart pointer from TR1 and requires a C++ compiler with TR1 support or an external TR1 implementation, such as the one provided by Boost. @@ -16,19 +16,20 @@ employee.hxx employee-odb.hxx employee-odb.ixx -employee-odb.cxx +employee-odb.cxx These files contain the database support code for the employee.hxx header and are generated by the ODB compiler from employee.hxx using the following command line: - odb -d --generate-query --default-pointer std::tr1::shared_ptr \ - employee.hxx + odb -d --generate-query --generate-session \ + --default-pointer std::tr1::shared_ptr employee.hxx Where stands for the database system we are using, for example, 'mysql'. - The --default-pointer option is used to make TR1 shared_ptr the default - object pointer. + The --generate-session option is used to enable session support for all + the persistent classes in employee.hxx. The --default-pointer option is + used to make TR1 shared_ptr the default object pointer. database.hxx Contains the create_database() function which instantiates the concrete @@ -39,7 +40,7 @@ driver.cxx headers to gain access to the persistent classes and their database support code. It also includes database.hxx for the create_database() function declaration. - + In main() the driver first calls create_database() to obtain the database instance. It then programmatically creates the database schema by executing a series of SQL statements. After that the driver creates a number of -- cgit v1.1