diff options
Diffstat (limited to 'odb/relational/sqlite/source.cxx')
-rw-r--r-- | odb/relational/sqlite/source.cxx | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/odb/relational/sqlite/source.cxx b/odb/relational/sqlite/source.cxx index 6a99fc8..a482184 100644 --- a/odb/relational/sqlite/source.cxx +++ b/odb/relational/sqlite/source.cxx @@ -239,6 +239,18 @@ namespace relational << "//" << endl; } + // If this is a wrapped composite value, then we need to + // "unwrap" it. For simple values this is taken care of + // by the value_traits specializations. + // + if (mi.wrapper != 0 && comp_value (mi.t)) + { + // Here we need the wrapper type, not the wrapped type. + // + member = "wrapper_traits< " + mi.fq_type (false) + " >::" + + "get_ref (" + member + ")"; + } + if (comp_value (mi.t)) traits = "composite_value_traits< " + mi.fq_type () + " >"; else @@ -333,8 +345,9 @@ namespace relational virtual void traverse_composite (member_info& mi) { - os << "if (" << traits << "::init (i." << mi.var << "value, " << - member << "))" + os << "if (" << traits << "::init (" << endl + << "i." << mi.var << "value," << endl + << member << "))" << "{" << "grew = true;" << "}"; @@ -413,6 +426,18 @@ namespace relational << "//" << endl; } + // If this is a wrapped composite value, then we need to + // "unwrap" it. For simple values this is taken care of + // by the value_traits specializations. + // + if (mi.wrapper != 0 && comp_value (mi.t)) + { + // Here we need the wrapper type, not the wrapped type. + // + member = "wrapper_traits< " + mi.fq_type (false) + " >::" + + "set_ref (" + member + ")"; + } + if (comp_value (mi.t)) traits = "composite_value_traits< " + mi.fq_type () + " >"; else @@ -497,8 +522,10 @@ namespace relational virtual void traverse_composite (member_info& mi) { - os << traits << "::init (" << member << ", i." << - mi.var << "value, db);" + os << traits << "::init (" << endl + << member << "," << endl + << "i." << mi.var << "value," << endl + << "db);" << endl; } |