Bugs item #804968, was opened at 2003-09-12 11:55
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=804968&group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Joachim Van der Auwera (triathlon98)
Assigned to: Nobody/Anonymous (nobody)
Summary: EJB->SQL conversion bug with OR

Initial Comment:
Given the following EJBQL :



SELECT OBJECT(o) FROM Weight o WHERE ( 

o.sale.reference = ?1 ) OR ( o.purchase.reference = ?2 ) 

OR ( o.declaration.reference = ?3 )



with a pk field unid_uoid is converted to the folowing 

SQL :



SELECT t0_o.UNID_UOID FROM WEIGHT t0_o, 

WEIGHTGROUP t2_o_purchase, WEIGHTGROUP 

t1_o_sale, WEIGHTGROUP t3_o_declaration 

WHERE 

((t1_o_sale.f_Reference = ?) OR 

(t2_o_purchase.f_Reference = ?) OR 

(t3_o_declaration.f_Reference = ?)) AND 

(t0_o.f_Purchase_UOID=t2_o_purchase.UNID_UOID AND 

t0_o.f_Sale_UOID=t1_o_sale.UNID_UOID AND 

t0_o.f_Declaration_UOID=t3_o_declaration.UNID_UOID)



The correct SQL would be :



SELECT t0_o.UNID_UOID FROM WEIGHT t0_o, 

WEIGHTGROUP t2_o_purchase, WEIGHTGROUP 

t1_o_sale, WEIGHTGROUP t3_o_declaration 

WHERE (

((t1_o_sale.f_Reference = ?) AND 

t0_o.f_Sale_UOID=t1_o_sale.UNID_UOID ) OR 

((t2_o_purchase.f_Reference = ?) AND 

t0_o.f_Purchase_UOID=t2_o_purchase.UNID_UOID) OR 

((t3_o_declaration.f_Reference = ?) AND 

t0_o.f_Declaration_UOID=t3_o_declaration.UNID_UOID) 

)

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

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


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to