Hi
I have an EJBQL finder that appears to produce the incorrect result when deployed on JBoss 4.0.2. I wonder if anyone would like to comment on this: perhaps this is a know bug, maybe there is a work-around, or maybe I'm doing something wrong.
The situation: I have three entity beans: Course, Product and Group. There is a many-to-many relationship between Course and Group, and between Product and Group.
I have three finders:
<query> <query-method> <method-name>findWithCourses</method-name> <method-params> <method-param>java.lang.String</method-param> </method-params> </query-method> <ejb-ql><![CDATA[SELECT OBJECT(g) FROM GroupSchema g WHERE (g.school.id = ?1) AND (g.courses IS NOT EMPTY)]]></ejb-ql> </query>
<query> <query-method> <method-name>findWithProducts</method-name> <method-params> <method-param>java.lang.String</method-param> </method-params> </query-method> <ejb-ql><![CDATA[SELECT OBJECT(g) FROM GroupSchema g WHERE (g.school.id = ?1) AND (g.products IS NOT EMPTY)]]></ejb-ql> </query>
<query> <query-method> <method-name>findNonEmpty</method-name> <method-params> <method-param>java.lang.String</method-param> </method-params> </query-method> <ejb-ql><![CDATA[SELECT OBJECT(g) FROM GroupSchema g WHERE (g.school.id = ?1) AND ((g.courses IS NOT EMPTY) OR (g.products IS NOT EMPTY))]]></ejb-ql> </query>