Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Confused with a joint query in EJB QL

 
Yingliang Du
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a query like this:
<query>
<query-method>
<method-name>findByProcedureType</method-name>
<method-params>
<method-param>int</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT DISTINCT OBJECT(s) FROM SampleGroupEJB AS s, IN
(s.samples) AS t WHERE s.deleted=-1 AND s.procTypeId=?1 AND (s.numOfSamples=0
OR (t.deleted=-1 AND t.workflowDetail.status<>'Finished'))]]></ejb-ql>
</query>
The relationship was (1)SampleGroupEJB--(*)TestDataEJB, and (1)TestDataEJB--(1)WorkflowDetailEJB.
I wanted to get back (1.)all empty SampleGroups and (2.)all SampleGroups that contain TestData and related WorkflowDetail status was not 'Finished'. But this query only give me back part(2.) not part (1.).
Any idea?
Thank you very much!
Yingliang
 
Juan Rolando Prieur-Reza
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice question. I'm giving it some thought.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!