FAQ
SelectTranslator needs to support left join
-------------------------------------------

Key: CAY-929
URL: https://issues.apache.org/cayenne/browse/CAY-929
Project: Cayenne
Issue Type: Improvement
Components: Cayenne Core Library
Reporter: Ari Maniatis
Assignee: Andrus Adamchik


appendTable() in SelectTranslator.java simply appends a list of all tables referenced to the FROM clause. In some cases these tables should instead be added as a join (often a left join). This code needs to allow for that possibility. I can see some trivial ways to do this by hacking this code, but I am not confident of how this might fit into the grand plan of EJBQL and more. Will this code need to accommodate other more complex joins in the future (eg is there ever a need for outer joins?)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Search Discussions

  • Anonymous at Apr 29, 2008 at 9:27 pm
    [ https://issues.apache.org/cayenne/browse/CAY-929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Andrus Adamchik closed CAY-929.
    -------------------------------

    Resolution: Fixed
    Fix Version/s: 3.0
    SelectTranslator support for standard SQL join syntax, including outer joins
    ----------------------------------------------------------------------------

    Key: CAY-929
    URL: https://issues.apache.org/cayenne/browse/CAY-929
    Project: Cayenne
    Issue Type: Improvement
    Components: Cayenne Core Library
    Affects Versions: 3.0
    Reporter: Ari Maniatis
    Assignee: Andrus Adamchik
    Fix For: 3.0


    Currently select translator generates JOIN syntax in an old fashion way - adds all participating tables to the FROM clause of the query, adds join conditions to the WHERE clause. Among other things this limits us to only INNER JOINS on almost all DB's (except for maybe Oracle). Will need to change the translator to generate modern cross-db explicit join syntax that places all tables and conditions in the FROM clause. E.g.:
    Old: SELECT ... FROM ARTIST t0, PAINTING t1 WHERE t0.ARTIST_ID = t1.ARTIST_ID
    New: SELECT ... FROM ARTIST t0 JOIN PAINTING t1 ON (t0.ARTIST_ID = t1.ARTIST_ID)
    Things to consider:
    * Check all DbAdapters to see if some override the join generation methods and therefore need to be updated
    * This feature does not change the fact that SelectQuery itself still will not support explicit outer joins in the qualifier
    * Still the new API for joins should allow callers to specify what kind of join they want (so that we could use it in prefetches down the line)
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedDec 3, '07 at 10:37p
activeApr 29, '08 at 9:27p
posts2
users1
websitecayenne.apache.org

1 user in discussion

Anonymous: 2 posts

People

Translate

site design / logo © 2022 Grokbase