aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-09-18 18:49:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-09-18 18:49:01 +0200
commit7e4b32c8211e0cd9eadb6bd2604a40784fba24b3 (patch)
tree053e98b6da9ba7368dbac2cae5698d4cc33ef6cc
parentf70642bcdc61d679981a55ce9bcd88c08c8dadc1 (diff)
Fix bug in object loading views and objects with nested ids
-rw-r--r--odb/relational/source.hxx20
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;
}