aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ();