cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAY-1635) EJBQL: Fetch join and another join over the same relationship result in a conflicting alias
Date Tue, 01 Nov 2011 15:25:32 GMT
EJBQL: Fetch join and another join over the same relationship result in a conflicting alias
-------------------------------------------------------------------------------------------

                 Key: CAY-1635
                 URL: https://issues.apache.org/jira/browse/CAY-1635
             Project: Cayenne
          Issue Type: Bug
    Affects Versions: 3.1M3
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik


(this explodes, as Cayenne generates "t1" alias for both FETCH JOIN and implicit INNER JOIN
over the same relationship

buffer.append("SELECT g, count(g.linkedItems) FROM Gallery g");
buffer.append(" LEFT JOIN FETCH g.r1");
buffer.append(" WHERE g.r3 = ?1");
buffer.append(" AND g.r1.r2.location <> 'xyz'");
buffer.append(" GROUP BY g");

(this is a workaround - name your joins... still can't get used to this EJBQL style join handling)

buffer.append("SELECT g, count(g.linkedItems) FROM Gallery g");
buffer.append(" LEFT JOIN FETCH g.r1");
buffer.append(" JOIN g.r1 s");
buffer.append(" WHERE g.r3 = ?1");
buffer.append(" AND s.r2.location <> 'xyz'");
buffer.append(" GROUP BY g");

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message