You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Hugi Thordarson (JIRA)" <ji...@apache.org> on 2016/11/10 17:41:58 UTC

[jira] [Created] (CAY-2137) When generating SQL from EJBQL, use "AND" to separate multiple join conditions rather than a comma

Hugi Thordarson created CAY-2137:
------------------------------------

             Summary: When generating SQL from EJBQL, use "AND" to separate multiple join conditions rather than a comma
                 Key: CAY-2137
                 URL: https://issues.apache.org/jira/browse/CAY-2137
             Project: Cayenne
          Issue Type: Improvement
          Components: Core Library
    Affects Versions: 4.0.M4
            Reporter: Hugi Thordarson
            Priority: Minor


When Cayenne generates SQL for EJBQLQueries that use relationships with multiple joins, it puts commas between the join conditions in the resulting SQL-statement. This does not work with some databases (at least Informix) which wants “AND” between joins.

For example, this doesn’t work: 
…FROM bok_invoice_line t0 INNER JOIN bok_invoice t1 ON (t0.company = t1.company, t0.year = t1.year)

While this works:
…FROM bok_invoice_line t0 INNER JOIN bok_invoice t1 ON (t0.company = t1.company AND t0.year = t1.year)

If the same expression is used in a regular SelectQuery, Cayenne puts “AND” between the joins rather than commas and everything will work fine. This issue is for aligning the behaviour of these two to make it more compatible (use AND when generating SQL from EJBQL).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)