diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-14 16:35:43 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-14 16:35:43 +0200 |
commit | 95cb59ee9e7770bd38e14bc86069b7c4d80ea08e (patch) | |
tree | ef0fce963276730948ae8021eff6ed27b53b2b82 /odb/validator.cxx | |
parent | cebe8e9964267590a80965b98e6f8f1e8bb5059e (diff) |
Set polymorphic_objects feature if we have polymorphic-object-based view
We need the polymorphism-related includes in such a view's
implementation.
Diffstat (limited to 'odb/validator.cxx')
-rw-r--r-- | odb/validator.cxx | 16 |
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 |