diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-25 09:46:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-25 09:46:59 +0200 |
commit | 7998e33d631f969052503f18d435f3a52d1a1da4 (patch) | |
tree | 83bc54735c9f26a13a12798c2f57959253395973 /odb/mysql/result.txx | |
parent | 678d63d23829ac1ccf2dcab2f6c0f352a320d7b4 (diff) |
Pass id binding instead of id image in container traits
This will allow us to reuse things more.
Diffstat (limited to 'odb/mysql/result.txx')
-rw-r--r-- | odb/mysql/result.txx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/odb/mysql/result.txx b/odb/mysql/result.txx index db444eb..f6d0a79 100644 --- a/odb/mysql/result.txx +++ b/odb/mysql/result.txx @@ -39,13 +39,23 @@ namespace odb assert (!statements_.locked ()); typename object_statements<object_type>::auto_lock l (statements_); - typename object_traits::image_type& im (statements_.image ()); - object_traits::init (obj, im, this->database ()); + typename object_traits::image_type& i (statements_.image ()); + object_traits::init (obj, i, this->database ()); - // Initialize the id image and load the rest of the object + // Initialize the id image and binding and load the rest of the object // (containers, etc). // - object_traits::init (statements_.id_image (), object_traits::id (im)); + typename object_traits::id_image_type& idi (statements_.id_image ()); + object_traits::init (idi, object_traits::id (i)); + + binding& idb (statements_.id_image_binding ()); + if (idi.version != statements_.id_image_version () || idb.version == 0) + { + object_traits::bind (idb.bind, idi); + statements_.id_image_version (idi.version); + idb.version++; + } + object_traits::load_ (statements_, obj); statements_.load_delayed (); |