• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confused with a joint query in EJB QL

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice question. I'm giving it some thought.
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic