diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-27 12:31:52 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-27 12:31:52 +0200 |
commit | ef7dd01920a4a28ba3c4aad3abe69bd43beee9fa (patch) | |
tree | 3f61b7faf6db272c9182a523b43c545dd9870020 /odb/common.cxx | |
parent | f8699a40bcc099564f330fd937fa6de36d49c4d8 (diff) |
Make container schema override object schema
Diffstat (limited to 'odb/common.cxx')
-rw-r--r-- | odb/common.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/odb/common.cxx b/odb/common.cxx index fe77b2c..6880964 100644 --- a/odb/common.cxx +++ b/odb/common.cxx @@ -119,6 +119,7 @@ traverse (semantics::class_& c) if (table_prefix_.level == 0) { + table_prefix_.schema = schema (c.scope ()); table_prefix_.prefix = table_name (c); table_prefix_.prefix += "_"; table_prefix_.level = 1; @@ -134,6 +135,7 @@ traverse (semantics::class_& c) { table_prefix_.level = 0; table_prefix_.prefix.clear (); + table_prefix_.schema.clear (); } } else @@ -239,8 +241,13 @@ append (semantics::data_member& m, table_prefix& tp) p = n.qualifier (); else { - p = tp.prefix.qualifier (); - p.append (n.qualifier ()); + if (n.qualified ()) + { + p = tp.schema; + p.append (n.qualifier ()); + } + else + p = tp.prefix.qualifier (); } p.append (tp.level <= 1 ? ctx.options.table_prefix () : tp.prefix.uname ()); |