aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-01-05 13:51:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-01-05 13:51:25 +0200
commit846b3d7e6dc279c676af22dc4345ddd6d245353f (patch)
treea09c8c73ed87f0906a825dec8a051ee557f13e18
parent82eb3a23e679980671400995324516e022cbb957 (diff)
Load containers in query results and delayed loading
-rw-r--r--odb/mysql/object-statements.txx1
-rw-r--r--odb/mysql/result.txx9
2 files changed, 9 insertions, 1 deletions
diff --git a/odb/mysql/object-statements.txx b/odb/mysql/object-statements.txx
index 4051dd9..d2152f7 100644
--- a/odb/mysql/object-statements.txx
+++ b/odb/mysql/object-statements.txx
@@ -58,6 +58,7 @@ namespace odb
throw object_not_persistent ();
object_traits::init (*l.obj, image (), db);
+ object_traits::load_ (*this, *l.obj); // Load containers, etc.
g.release ();
}
}
diff --git a/odb/mysql/result.txx b/odb/mysql/result.txx
index 7c1fda0..e91d156 100644
--- a/odb/mysql/result.txx
+++ b/odb/mysql/result.txx
@@ -39,7 +39,14 @@ namespace odb
assert (!statements_.locked ());
typename object_statements<object_type>::auto_lock l (statements_);
- object_traits::init (obj, statements_.image (), this->database ());
+ typename object_traits::image_type& im (statements_.image ());
+ object_traits::init (obj, im, this->database ());
+
+ // Initialize the id image and load the rest of the object
+ // (containers, etc).
+ //
+ object_traits::init (statements_.id_image (), object_traits::id (im));
+ object_traits::load_ (statements_, obj);
statements_.load_delayed ();
l.unlock ();