Hi All
I am new to hibernate.
I am trying to do many-to-one mapping in hibernate.
I am using 2 tables :
1) UserTypes(usertypesid is primary key)
2) Users (userid is primary key and usertypesid is foreign key from usertypes table.)
And for the users table is as follows:
I have been able to insert the records into user tables by mapping successfully but the
problem comes when i try to retrieve the records from userypes table.. It also retrieve the records from the user table i dnt knw y??
I have tried all the forums and articles now this is my last hope. Please help me if anybody has any idea.
The hql for usertypes is "
And this is generating the sql like the followings:
I am not able to understand y its also showing the select sql from user table?
Anybody has any idea advise my..
Thanks a lot..