summaryrefslogtreecommitdiff
path: root/odb/common.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-24 17:11:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-24 17:11:43 +0200
commitaaf47c94726ed05ca8c6790f0946e341125e7eb4 (patch)
treea31f162f2e4007069e5bec84e267f02d7f8eb923 /odb/common.cxx
parente799a139472a76234ccbdedd5c423ced4c478a86 (diff)
Don't append table prefix to names that already have it (container tables)
Diffstat (limited to 'odb/common.cxx')
-rw-r--r--odb/common.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/odb/common.cxx b/odb/common.cxx
index 2c23e76..130d5ec 100644
--- a/odb/common.cxx
+++ b/odb/common.cxx
@@ -128,8 +128,8 @@ traverse (semantics::data_member& m)
//
if (m.count ("table"))
{
- if (om_.table_prefix_.level == 1)
- om_.table_prefix_.prefix.clear ();
+ if (om_.table_prefix_.level <= 1)
+ om_.table_prefix_.prefix = om_.options.table_prefix ();
om_.table_prefix_.prefix += m.get<string> ("table");
}
@@ -141,6 +141,9 @@ traverse (semantics::data_member& m)
string name (om_.public_name_db (m));
size_t n (name.size ());
+ if (om_.table_prefix_.prefix.empty ())
+ om_.table_prefix_.prefix = om_.options.table_prefix ();
+
om_.table_prefix_.prefix += name;
if (n != 0 && name[n - 1] != '_')