aboutsummaryrefslogtreecommitdiff
path: root/c++11
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-04-26 11:29:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-04-26 11:29:05 +0200
commit3506ef645e4cd26aebb73f493001d584e4cce22a (patch)
treebfc53872849a256861903a21daa55ebf097f0f39 /c++11
parentab994fdada3eebc794d6b1686f55a35420e4d758 (diff)
Make session optional
Diffstat (limited to 'c++11')
-rw-r--r--c++11/README10
-rw-r--r--c++11/employee.hxx4
2 files changed, 8 insertions, 6 deletions
diff --git a/c++11/README b/c++11/README
index 86c0efe..72ed07e 100644
--- a/c++11/README
+++ b/c++11/README
@@ -10,10 +10,12 @@ employee.hxx
Header file defining the 'employee', 'employer', and 'pension_fund'
persistent classes. We use the standard std::shared_ptr/weak_ptr smart
pointers as well as their lazy versions provided by ODB to establish a
- bidirectional employee-employer relationship. Because we don't share the
- 'pension_fund' objects, we use std::unique_ptr as an object pointer for
- this persistent class. We also use the std::unordered_set container to
- keep track of the employee's email addresses.
+ bidirectional employee-employer relationship. We also enable session
+ support for these two classes using the 'db session' pragma. Because
+ we don't share the 'pension_fund' objects, we use std::unique_ptr
+ as an object pointer for this persistent class. We also use the
+ std::unordered_set container to keep track of the employee's email
+ addresses.
employee-odb.hxx
employee-odb.ixx
diff --git a/c++11/employee.hxx b/c++11/employee.hxx
index 3750ca0..0c2abc7 100644
--- a/c++11/employee.hxx
+++ b/c++11/employee.hxx
@@ -17,7 +17,7 @@
class employer;
class employee;
-#pragma db object pointer(std::shared_ptr)
+#pragma db object pointer(std::shared_ptr) session
class employer
{
public:
@@ -60,7 +60,7 @@ private:
employees_type employees_;
};
-#pragma db object pointer(std::shared_ptr)
+#pragma db object pointer(std::shared_ptr) session
class employee
{
public: