[jboss-user] [EJB 3.0] - Problems with EJB-QL - not empty, OR

CarstenRudat do-not-reply at jboss.com
Tue Jul 25 05:07:25 EDT 2006


Hi all,

I tried to find some entities where a relation (relation) is null or a specific attibute of a related entity is x:

SELECT o FROM MyObject o WHERE (o.relation is empty)  OR  ((o.relation is not empty) AND (o.relation.attribute LIKE 'x'))

But this doesn't work. Debug enabled, I see the SQL-Statement (MySQL) and I guess the paranthesis are wrong: 

select ... where ...  not (exists (select ...)) or (exists (select ...)) and (...attribute like 'x'))

I need paranthesis around the last two blocks, but I realy don't know how?!


Any help, thank you!

Carsten

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960621#3960621

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960621



More information about the jboss-user mailing list