Beginner |
|
Joined: Mon Nov 22, 2004 8:53 pm Posts: 23
|
I have 2 tables and objects: Car and User
Car table:
car_id
update_user_id
User table:
user_id
So I have them mapped as follows:
<class name="Car" table="Car">
<id name="id" column="car_id">..</id>
<many-to-one name="updateUser" class="User" column="update_user_id"/>
</class>
<class name="User" table="User">
<id name="id" column="user_id">..</id>
</class>
I'm wondering how to construct a Criteria Query for getting all of the users that have been assigned as an updateUser for Car.
The SQL would be select user_id from User, Car where update_user_id = user_id. How do I construct the Criteria Query?
Thanks!
Hibernate version:2.1.6
|
|