-->
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: HQL query for selecting based on set of values in a collect
PostPosted: Fri Oct 29, 2004 1:49 pm 
Newbie

Joined: Fri Oct 29, 2004 1:41 pm
Posts: 1
Hibernate version:
2.1.6

Name and version of the database you are using:
MySQL 4.0.18


Hi:

I am new to Hibernate and I went through most
of the postings here and I am pretty sure this doesn't
belong in the FAQ (I went through them also).

My question is regarding the HQL query. It looked
simple to me but I couldn't get the correct HQL query
for this scenario.

'Student' object contains a collection (set) of 'Course' objects
he registered to. I have one-to-many mapping from
'Student' to 'Course'. My problem is to come up with the
HQL query to get all 'Student' objects who have registered to
a given set of 'Course's. I would like to get all the students who
have registered for all of 'MATH101', 'ECON101' and 'CSC101'.

Any pointers for HQL or Criteria based queries for the above.
I know I am missing something very simple here but I can't put
my hand on it.

Thanks in advance,
Suresh


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.