These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: question about criteria
PostPosted: Mon Oct 17, 2005 5:14 am 
Newbie

Joined: Wed Apr 13, 2005 8:10 am
Posts: 15
Hi,

I have the following model:

Person (pid)
Job ( fk_pid, job )

so its one-to-many.

Using the criteria API, I need to generate a query which check for all persons with a certain List of jobs:

in SQL it would look like
Code:
select pid from Person
where 3 = count(
  select * from Job
  where pid = fk_pid
    and job in ( a , b , c )
);

How do I create such a criteria?
Thanx in advance,
Ron


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.