Hi ,
I have a scenario where I have a table user which has a key userId I have another 3 tables, student, admin, faculty with keys studentid, adminId, facultyId.
I want to make foreign key relationship between userid and other 3 keys, where user table will be the parent table and other 3 would be child.
How can i do it in hibernate?
I know i can declare one-to-one mapping in one table let say user and userdetails where userid will be referenced by userDetailsId.
But in this case userid will be referanced by 3 different tables.
for ex: if userids are 1,2,3,4,5,6, studentid: 1,2 adminid: 3,4 facultyId: 5,6. How to do this in hibernate?
|