You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Øyvind Harboe (JIRA)" <ji...@apache.org> on 2006/05/31 11:33:49 UTC

[JIRA] Created: (CAY-560) Add support for outer joins

Add support for outer joins
---------------------------

         Key: CAY-560
         URL: http://issues.apache.org/cayenne/browse/CAY-560
     Project: Cayenne
        Type: New Feature

  Components: Cayenne Core Library  
    Versions: AFTER 1.2    
    Reporter: Øyvind Harboe


Currently outer joins are not supported.

See thread:

http://objectstyle.org/cayenne/lists/cayenne-user/2006/05/0165.html




 // This Java code will result in the SQL query immediately below...
SelectQuery query1=new SelectQuery(ElcRole.class);
query1.setQualifier(ExpressionFactory.matchExp(ElcRole.ELC_ROLEMEMBER_ARRAY_PROPERTY + "." + ElcRolemember.TO_SYS_USER_PROPERTY, getSysUser()).
  orExp(ExpressionFactory.matchExp(ElcRole.TO_SYS_USER_PROPERTY, getSysUser())));
List l=context.performQuery(query1);

Generates =>
 
SELECT DISTINCT t0.ELCROLE_NAME, t0.ELCROLE_ID, t0.SYSUSER_ID
FROM ELC_ROLE t0 LEFT OUTER JOIN
                      ELC_ROLEMEMBER t1 ON t0.ELCROLE_ID = t1.ELCROLE_ID
WHERE (t1.SYSUSER_ID = 'BD93F348-8C02-4742-BA97-2456E5CD3881') OR
                      (t0.SYSUSER_ID = 'BD93F348-8C02-4742-BA97-2456E5CD3881')

But should(?) have generated =>

SELECT DISTINCT t0.ELCROLE_NAME, t0.ELCROLE_ID, t0.SYSUSER_ID
FROM ELC_ROLE t0 LEFT OUTER JOIN
                      ELC_ROLEMEMBER t1 ON t0.ELCROLE_ID = t1.ELCROLE_ID
WHERE (t1.SYSUSER_ID = 'BD93F348-8C02-4742-BA97-2456E5CD3881') OR
                      (t0.SYSUSER_ID = 'BD93F348-8C02-4742-BA97-2456E5CD3881')
                      


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/cayenne/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira