Bugs item #705732, was opened at 2003-03-18 19:43
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=705732&group_id=22866

Category: JBossCMP
Group: v3.2
>Status: Closed
>Resolution: Out of Date
Priority: 5
Submitted By: David Calvente (davidcalvente)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: Incorrect behaviour of WHERE clause using relations

Initial Comment:
Using this EJB-QL statement:

SELECT DISTINCT OBJECT(cli)
FROM customer AS cu
WHERE     (cu.companyKey = ?2 )
 AND (cu.city.stateKey = ?1 OR cu.city IS NULL)

The container generates an SQL statement like this:

SELECT DISTINCT (...some fields..)
FROM customerTable AS cu, cityTable as ct
WHERE     (cu.companyKey = '12') 

AND (ct.stateKey = '3' OR cu.cityKey IS NULL)
... here is the problem....
AND (cu.cityKey = ct.cityKey)

This sentence has a potential missmatch when cu.city 
(a CMR) is NULL due to the fact that JBossCMP 
allways post a final AND in the WHERE clause with all 
the table relations needed.

The correct statement should be:


SELECT DISTINCT  (...some fields..)
FROM customerTable AS cu, cityTable as ct
WHERE     (cu.companyKey = '12') 

AND ((ct.stateKey = '3'  AND ct.cityKey = cy.cityKey) 
OR (ct.cityKey IS NULL))




----------------------------------------------------------------------

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-08-04 17:10

Message:
Logged In: YES 
user_id=543482

Please, try this compiler
http://www.jboss.org/wiki/Wiki.jsp?page=PlugableQlCompiler
and reopen if it's still a problem. Thanks.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=705732&group_id=22866


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to