You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (Created) (JIRA)" <ji...@apache.org> on 2011/11/01 16:25:32 UTC

[jira] [Created] (CAY-1635) EJBQL: Fetch join and another join over the same relationship result in a conflicting alias

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