From 83355694c8bd7a9aa9a222ae9d12274c4dab0bac Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 2 May 2016 10:52:31 +0200 Subject: Make sure object statements included for object loading views --- odb/validator.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'odb') 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; + } } } } -- cgit v1.1