From cebe8e9964267590a80965b98e6f8f1e8bb5059e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Apr 2015 16:33:47 +0200 Subject: Detect and ignore transient value base --- odb/common-query.cxx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/odb/common-query.cxx b/odb/common-query.cxx index 851854b..25007a0 100644 --- a/odb/common-query.cxx +++ b/odb/common-query.cxx @@ -123,23 +123,27 @@ traverse (semantics::class_& c) { object_columns_base::traverse (c); } - else if (c.get ("object-count") != 0) // View. + else if (view (c)) { - view_objects& objs (c.get ("objects")); - - for (view_objects::const_iterator i (objs.begin ()); - i < objs.end (); - ++i) + if (c.get ("object-count") != 0) { - if (i->kind != view_object::object) - continue; // Skip tables. + view_objects& objs (c.get ("objects")); - if (i->alias.empty ()) - continue; + for (view_objects::const_iterator i (objs.begin ()); + i < objs.end (); + ++i) + { + if (i->kind != view_object::object) + continue; // Skip tables. - generate (i->alias); + if (i->alias.empty ()) + continue; + + generate (i->alias); + } } } + // Otherwise it is a transient base (of a composite value). if (nl_) os << endl; -- cgit v1.1