From 2b02d443ab344bc02dfc2891fb1a57c6520c393f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Aug 2010 17:05:24 +0200 Subject: Use type names as specified in the header that we compile --- odb/mysql/common.cxx | 5 ++++- odb/mysql/header.cxx | 16 ++++++++-------- odb/mysql/source.cxx | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) (limited to 'odb/mysql') diff --git a/odb/mysql/common.cxx b/odb/mysql/common.cxx index 011e510..d294527 100644 --- a/odb/mysql/common.cxx +++ b/odb/mysql/common.cxx @@ -198,7 +198,10 @@ namespace mysql void query_column:: pre (type& m) { - type_ = "mysql::value_traits< " + m.type ().fq_name () + " >::value_type"; + type_ = "mysql::value_traits< " + + m.type ().fq_name (m.belongs ().hint ()) + + " >::value_type"; + name_ = escape (public_name (m)); if (decl_) diff --git a/odb/mysql/header.cxx b/odb/mysql/header.cxx index 237cb85..bdb98a4 100644 --- a/odb/mysql/header.cxx +++ b/odb/mysql/header.cxx @@ -216,12 +216,6 @@ namespace mysql string const& type (c.fq_name ()); - // Find the id member and type. - // - id_member_.traverse (c); - semantics::data_member& id (*id_member_.member ()); - semantics::type& id_type (id.type ()); - member_count_.traverse (c); size_t column_count (member_count_.count ()); @@ -241,8 +235,14 @@ namespace mysql // id_type // - os << "typedef " << id_type.fq_name () << " id_type;" - << endl; + { + id_member_.traverse (c); + semantics::data_member& id (*id_member_.member ()); + + os << "typedef " << id.type ().fq_name (id.belongs ().hint ()) << + " id_type;" + << endl; + } // image_type // diff --git a/odb/mysql/source.cxx b/odb/mysql/source.cxx index 9cf69b1..1a9e6c8 100644 --- a/odb/mysql/source.cxx +++ b/odb/mysql/source.cxx @@ -353,7 +353,7 @@ namespace mysql virtual void pre (type& m) { - type = m.type ().fq_name (); + type = m.type ().fq_name (m.belongs ().hint ()); if (id_) member = "id"; @@ -516,7 +516,7 @@ namespace mysql virtual void pre (type& m) { - type = m.type ().fq_name (); + type = m.type ().fq_name (m.belongs ().hint ()); os << "// " << m.name () << endl << "//" << endl; -- cgit v1.1