aboutsummaryrefslogtreecommitdiff
path: root/relationship
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-26 09:17:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-26 09:17:15 +0200
commit6ae5df8a85cd0344cc12effe788f7e09d06df372 (patch)
treefef101ef0ab4c83dff84370e12640f900101e806 /relationship
parente159da71e25aa50fc73479f9aa7aef7185c28a1c (diff)
Add note on embedded schemas
Diffstat (limited to 'relationship')
-rw-r--r--relationship/README14
1 files changed, 8 insertions, 6 deletions
diff --git a/relationship/README b/relationship/README
index 6400960..f3e4e9c 100644
--- a/relationship/README
+++ b/relationship/README
@@ -1,7 +1,7 @@
This example shows how to declare and use unidirectional to-one and to-many
-relationships between persistent objects.
+relationships between persistent objects.
-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.
@@ -14,7 +14,7 @@ employee.hxx
employee-odb.hxx
employee-odb.ixx
-employee-odb.cxx
+employee-odb.cxx
employee.sql
The first three files contain the database support code and the last file
contains the database schema for the employee.hxx header.
@@ -40,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 creates a number of 'employee', 'employer', and 'project'
objects, sets the relationships between them, and persists them in the
@@ -49,8 +49,10 @@ driver.cxx
driver performs a database query which uses a data member from a related
object in its criterion.
-To run the example we first need to create the database schema. Using MySQL
-as an example, this can be achieved with the following command:
+To run the example we may first need to create the database schema (for some
+database systems, such as SQLite, the schema is embedded into the generated
+code which makes this step unnecessary). Using MySQL as an example, this
+can be achieved with the following command:
mysql --user=odb_test --database=odb_test < employee.sql