hibernate mapping for more than one foreign key to a single table

Joined
Oct 27, 2009
Messages
1
Reaction score
0
8) Hi,

I am having problem in mapping two classes in hibernate.

I have a class User which has user_id as primary key.
I have another class UserBook which have (user_id, book_id and supervisor_id)
as primary key and (user_id and supervisor_id) as foreign key to User(user_id).

I have used many-to-one simple and composite variations of hibernate but of no use than getting errors.

Have visited most of the blogs but found no solutions.
Please help me in getting this done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top