diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-18 18:49:01 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-18 18:49:01 +0200 |
commit | 7e4b32c8211e0cd9eadb6bd2604a40784fba24b3 (patch) | |
tree | 053e98b6da9ba7368dbac2cae5698d4cc33ef6cc /odb/relational/source.hxx | |
parent | f70642bcdc61d679981a55ce9bcd88c08c8dadc1 (diff) |
Fix bug in object loading views and objects with nested ids
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r-- | odb/relational/source.hxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx index dd6054a..a30c183 100644 --- a/odb/relational/source.hxx +++ b/odb/relational/source.hxx @@ -3102,10 +3102,24 @@ namespace relational for (size_t i (0); i < poly_depth - 1; ++i) id_im += (i == 0 ? ".base" : "->base"); - string const& n (idm->front ()->name ()); - id_var = id_im + (poly_derived ? "->" : ".") + n + - (n[n.size () - 1] == '_' ? "" : "_"); + string n; + for (data_member_path::const_iterator i (idm->begin ()); + i != idm->end (); + ++i) + { + // The same logic as in member_base. + // + if (!n.empty ()) + n += "value."; // Composite. + + string const& name ((*i)->name ()); + n += name; + + if (n[n.size () - 1] != '_') + n += '_'; + } + id_var = id_im + (poly_derived ? "->" : ".") + n; id_im = (poly_derived ? "*i." : "i.") + id_im; } |