diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-05-04 20:59:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-05-04 20:59:54 +0200 |
commit | 18f723723ed93b78c52be3f1f9e4137006299812 (patch) | |
tree | 87270d03c7fa712822bad769860821e099fcc6f5 | |
parent | 3d1985a7d0d282998a0995c5167592f5305960f0 (diff) |
Ignore section logic when dealing with container elements
The container member itself can be in a section.
-rw-r--r-- | odb/relational/mysql/context.cxx | 6 | ||||
-rw-r--r-- | odb/relational/pgsql/context.cxx | 6 | ||||
-rw-r--r-- | odb/relational/sqlite/context.cxx | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/odb/relational/mysql/context.cxx b/odb/relational/mysql/context.cxx index c03a77a..4a5187a 100644 --- a/odb/relational/mysql/context.cxx +++ b/odb/relational/mysql/context.cxx @@ -214,7 +214,11 @@ namespace relational virtual bool pre (member_info& mi) { - return (section_ == 0 && !separate_load (mi.m)) || + // If we have a key prefix (container), then it can't be in a + // section (while mi.m can). + // + return !key_prefix_.empty () || + (section_ == 0 && !separate_load (mi.m)) || (section_ != 0 && *section_ == section (mi.m)); } diff --git a/odb/relational/pgsql/context.cxx b/odb/relational/pgsql/context.cxx index f8a9fe2..cd73cf9 100644 --- a/odb/relational/pgsql/context.cxx +++ b/odb/relational/pgsql/context.cxx @@ -170,7 +170,11 @@ namespace relational virtual bool pre (member_info& mi) { - return (section_ == 0 && !separate_load (mi.m)) || + // If we have a key prefix (container), then it can't be in a + // section (while mi.m can). + // + return !key_prefix_.empty () || + (section_ == 0 && !separate_load (mi.m)) || (section_ != 0 && *section_ == section (mi.m)); } diff --git a/odb/relational/sqlite/context.cxx b/odb/relational/sqlite/context.cxx index 94b8067..a959477 100644 --- a/odb/relational/sqlite/context.cxx +++ b/odb/relational/sqlite/context.cxx @@ -177,7 +177,11 @@ namespace relational virtual bool pre (member_info& mi) { - return (section_ == 0 && !separate_load (mi.m)) || + // If we have a key prefix (container), then it can't be in a + // section (while mi.m can). + // + return !key_prefix_.empty () || + (section_ == 0 && !separate_load (mi.m)) || (section_ != 0 && *section_ == section (mi.m)); } |