aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-14 16:35:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-14 16:35:43 +0200
commit95cb59ee9e7770bd38e14bc86069b7c4d80ea08e (patch)
treeef0fce963276730948ae8021eff6ed27b53b2b82
parentcebe8e9964267590a80965b98e6f8f1e8bb5059e (diff)
Set polymorphic_objects feature if we have polymorphic-object-based view
We need the polymorphism-related includes in such a view's implementation.
-rw-r--r--odb/validator.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/odb/validator.cxx b/odb/validator.cxx
index e80f4d8..8afdeb3 100644
--- a/odb/validator.cxx
+++ b/odb/validator.cxx
@@ -1423,11 +1423,25 @@ namespace
}
virtual void
- traverse_view (type&)
+ traverse_view (type& c)
{
// We don't check for the column count here since we may want to
// allow certain kinds of empty views. Instead, this is handled
// in relational::validation.
+
+ // See if any of the associated objects are polymorphic. If so,
+ // we need to include polymorphism-specific headers.
+ //
+ if (c.count ("objects"))
+ {
+ view_objects& objs (c.get<view_objects> ("objects"));
+
+ for (view_objects::iterator i (objs.begin ()); i != objs.end (); ++i)
+ {
+ if (i->kind == view_object::object && polymorphic (*i->obj))
+ features.polymorphic_object = true;
+ }
+ }
}
virtual void