diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-06 08:57:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-06 08:57:30 +0200 |
commit | f5e457f5dee11cbd20fc3557f79d6e1f235fb89f (patch) | |
tree | 17b21ea5494e37aea6a336284990ebb6424466e8 /odb/relational/processor.cxx | |
parent | 2ca4828d303fdd27c573429910f7a25fd1e3727c (diff) |
Implement join types support in views
Diffstat (limited to 'odb/relational/processor.cxx')
-rw-r--r-- | odb/relational/processor.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/odb/relational/processor.cxx b/odb/relational/processor.cxx index 16904b6..9442850 100644 --- a/odb/relational/processor.cxx +++ b/odb/relational/processor.cxx @@ -1344,6 +1344,15 @@ namespace relational for (view_objects::iterator i (objs.begin ()); i != objs.end (); ++i) { + if (i == objs.begin () && i->join != view_object::left) + { + error (i->loc) + << "no join type can be specified for the first associated " + << (i->kind == view_object::object ? "object" : "table") + << endl; + throw operation_failed (); + } + if (i->kind != view_object::object) { // Make sure we have join conditions for tables unless it @@ -1362,11 +1371,13 @@ namespace relational // If we have to generate the query and there was no JOIN // condition specified by the user, try to come up with one - // automatically based on object relationships. + // automatically based on object relationships. CROSS JOIN + // has no condition. // if (vq.kind == view_query::condition && i->cond.empty () && - i != objs.begin ()) + i != objs.begin () && + i->join != view_object::cross) { relationships rs; |