summaryrefslogtreecommitdiff
path: root/odb/relational/mysql/common.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/relational/mysql/common.hxx')
-rw-r--r--odb/relational/mysql/common.hxx30
1 files changed, 22 insertions, 8 deletions
diff --git a/odb/relational/mysql/common.hxx b/odb/relational/mysql/common.hxx
index a85a75e..66269c6 100644
--- a/odb/relational/mysql/common.hxx
+++ b/odb/relational/mysql/common.hxx
@@ -29,9 +29,13 @@ namespace relational
struct member_info
{
semantics::data_member& m; // Member.
- semantics::type& t; // Member C++ type (m.type () may != t).
- semantics::type* wrapper; // Wrapper type if member is a wrapper.
+ semantics::type& t; // Cvr-unqualified member C++ type, note
+ // that m.type () may not be the same as t.
+ semantics::type* wrapper; // Wrapper type if member is a composite or
+ // container wrapper, also cvr-unqualified.
// In this case t is the wrapped type.
+ bool cq; // True if the original (wrapper) type
+ // is const-qualified.
sql_type const* st; // Member SQL type (only simple values).
string& var; // Member variable name with trailing '_'.
@@ -40,21 +44,29 @@ namespace relational
string
fq_type (bool unwrap = true) const
{
+ semantics::names* hint;
+
if (wrapper != 0 && unwrap)
{
- // Use the hint from the wrapper.
+ // Use the hint from the wrapper unless the wrapped type
+ // is qualified.
//
- return t.fq_name (
- wrapper->get<semantics::names*> ("wrapper-hint"));
+ hint = wrapper->get<semantics::names*> ("wrapper-hint");
+ utype (*context::wrapper (*wrapper), hint);
+ return t.fq_name (hint);
}
// Use the original type from 'm' instead of 't' since the hint
// may be invalid for a different type. Plus, if a type is
// overriden, then the fq_type must be as well.
//
- return fq_type_.empty ()
- ? m.type ().fq_name (m.belongs ().hint ())
- : fq_type_;
+ if (fq_type_.empty ())
+ {
+ semantics::type& t (utype (m, hint));
+ return t.fq_name (hint);
+ }
+ else
+ return fq_type_;
}
string const& fq_type_;
@@ -62,11 +74,13 @@ namespace relational
member_info (semantics::data_member& m_,
semantics::type& t_,
semantics::type* wrapper_,
+ bool cq_,
string& var_,
string const& fq_type)
: m (m_),
t (t_),
wrapper (wrapper_),
+ cq (cq_),
st (0),
var (var_),
fq_type_ (fq_type)