From 18f723723ed93b78c52be3f1f9e4137006299812 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 May 2016 20:59:54 +0200 Subject: Ignore section logic when dealing with container elements The container member itself can be in a section. --- odb/relational/mysql/context.cxx | 6 +++++- odb/relational/pgsql/context.cxx | 6 +++++- odb/relational/sqlite/context.cxx | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'odb') 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)); } -- cgit v1.1