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
|