Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-2137

When generating SQL from EJBQL, use "AND" to separate multiple join conditions rather than a comma

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0.M4
    • Fix Version/s: None
    • Component/s: Core Library
    • Labels:
      None

      Description

      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).

        Attachments

          Activity

            People

            • Assignee:
              ntimofeev Nikita Timofeev
              Reporter:
              hugith Hugi Thordarson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: