diff options
Diffstat (limited to 'odb/relational/sqlite')
-rw-r--r-- | odb/relational/sqlite/common.cxx | 9 | ||||
-rw-r--r-- | odb/relational/sqlite/common.hxx | 8 | ||||
-rw-r--r-- | odb/relational/sqlite/header.cxx | 2 | ||||
-rw-r--r-- | odb/relational/sqlite/source.cxx | 8 |
4 files changed, 19 insertions, 8 deletions
diff --git a/odb/relational/sqlite/common.cxx b/odb/relational/sqlite/common.cxx index 357fb87..e3bf73c 100644 --- a/odb/relational/sqlite/common.cxx +++ b/odb/relational/sqlite/common.cxx @@ -33,9 +33,10 @@ namespace relational var = name + (name[name.size () - 1] == '_' ? "" : "_"); } - bool cq (type_override_ != 0 ? false: const_type (m.type ())); + bool cq (type_override_ != 0 ? false : const_type (m.type ())); semantics::type& t (type_override_ != 0 ? *type_override_ : utype (m)); + semantics::type* cont; if (semantics::class_* c = composite_wrapper (t)) { // If t is a wrapper, pass the wrapped type. Also pass the @@ -53,12 +54,14 @@ namespace relational post (mi); } } - else if (semantics::type* c = container_wrapper (t)) + // This cannot be a container if we have a type override. + // + else if (type_override_ == 0 && (cont = context::container (m))) { // The same unwrapping logic as for composite values. // member_info mi (m, - *c, + *cont, (wrapper (t) ? &t : 0), cq, var, diff --git a/odb/relational/sqlite/common.hxx b/odb/relational/sqlite/common.hxx index c998607..3bdc01e 100644 --- a/odb/relational/sqlite/common.hxx +++ b/odb/relational/sqlite/common.hxx @@ -88,6 +88,14 @@ namespace relational } }; + bool + container (member_info& mi) + { + // This cannot be a container if we have a type override. + // + return type_override_ == 0 && context::container (mi.m); + } + // The false return value indicates that no further callbacks // should be called for this member. // diff --git a/odb/relational/sqlite/header.cxx b/odb/relational/sqlite/header.cxx index 87faf20..1a2db32 100644 --- a/odb/relational/sqlite/header.cxx +++ b/odb/relational/sqlite/header.cxx @@ -31,7 +31,7 @@ namespace relational virtual bool pre (member_info& mi) { - if (container (mi.t)) + if (container (mi)) return false; image_type = member_image_type_.image_type (mi.m); diff --git a/odb/relational/sqlite/source.cxx b/odb/relational/sqlite/source.cxx index 041f8aa..32ac13e 100644 --- a/odb/relational/sqlite/source.cxx +++ b/odb/relational/sqlite/source.cxx @@ -34,7 +34,7 @@ namespace relational virtual bool pre (member_info& mi) { - if (container (mi.t)) + if (container (mi)) return false; ostringstream ostr; @@ -203,7 +203,7 @@ namespace relational virtual bool pre (member_info& mi) { - if (container (mi.t)) + if (container (mi)) return false; ostringstream ostr; @@ -288,7 +288,7 @@ namespace relational // Ignore containers (they get their own table) and inverse // object pointers (they are not present in this binding). // - if (container (mi.t) || inverse (mi.m, key_prefix_)) + if (container (mi) || inverse (mi.m, key_prefix_)) return false; if (!member_override_.empty ()) @@ -498,7 +498,7 @@ namespace relational virtual bool pre (member_info& mi) { - if (container (mi.t)) + if (container (mi)) return false; if (!member_override_.empty ()) |