diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-24 12:35:08 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-24 12:35:08 +0200 |
commit | 8f59ca1a8d7093655f8f7d61f101abc6df3839d5 (patch) | |
tree | 2555c001df7b81560bdc3c579f8c84260c168203 /odb/common.cxx | |
parent | 9cb4ce54829fb2f091e8690b591440b4369a1387 (diff) |
Generalization work for MySQL and SQLite support
Diffstat (limited to 'odb/common.cxx')
-rw-r--r-- | odb/common.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/odb/common.cxx b/odb/common.cxx index 1115565..f82d3d9 100644 --- a/odb/common.cxx +++ b/odb/common.cxx @@ -149,6 +149,11 @@ traverse (semantics::data_member& m) // void object_columns_base:: +flush () +{ +} + +void object_columns_base:: composite (semantics::data_member&, semantics::class_& c) { inherits (c); @@ -178,6 +183,9 @@ traverse_composite (semantics::data_member& m, } composite (m, c); + + if (!member_.first_) + flush (); } void object_columns_base:: @@ -190,6 +198,11 @@ traverse (semantics::class_& c) if (!(obj || context::comp_value (c))) return; + bool f (top_level_); + + if (top_level_) + top_level_ = false; + semantics::class_* prev; if (obj) { @@ -202,6 +215,9 @@ traverse (semantics::class_& c) if (obj) object = prev; + + if (f && !member_.first_) + flush (); } void object_columns_base::member:: @@ -243,9 +259,10 @@ traverse (semantics::data_member& m) } else { - oc_.column (m, prefix_ + column_name (m), first_); - - if (first_) - first_ = false; + if (oc_.column (m, prefix_ + column_name (m), first_)) + { + if (first_) + first_ = false; + } } } |