I have a class that has a set with the following properties:
Code:
<set name="students" table="usersStudents">
<key column="userId"/>
<element column="student" type="string"/>
</set>
I want to be able to query based on this set of data with a query like:
List l = session.createQuery("FROM User WHERE students = ?").setString(0, studentNumber).list();
Where basically I want to return all the records that have a specific "student" number in the set. What am I doing wrong what if the syntax for my where statement?
Thanks, I am new to hibernate, so please be gentle.
Thanks