aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-05-02 10:52:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-05-02 10:52:31 +0200
commit83355694c8bd7a9aa9a222ae9d12274c4dab0bac (patch)
treed583ef6d0dccb398b3b6efa38ea6c2a0ec4e0b99
parente93bcf3df1dd47de67a6d148c966be838b35228f (diff)
Make sure object statements included for object loading views
-rw-r--r--odb/validator.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/odb/validator.cxx b/odb/validator.cxx
index 51768a0..f5c4c33 100644
--- a/odb/validator.cxx
+++ b/odb/validator.cxx
@@ -1666,7 +1666,9 @@ namespace
// in relational::validation.
// See if any of the associated objects are polymorphic. If so,
- // we need to include polymorphism-specific headers.
+ // we need to include polymorphism-specific headers. Also, if the
+ // view is loading the object, then we will need the corresponding
+ // statements.
//
if (c.count ("objects"))
{
@@ -1676,6 +1678,12 @@ namespace
{
if (i->kind == view_object::object && polymorphic (*i->obj))
features.polymorphic_object = true;
+ else if (i->ptr != 0)
+ {
+ (id_member (*i->obj) != 0
+ ? features.simple_object
+ : features.no_id_object) = true;
+ }
}
}
}