-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Multiple one to one mapping
PostPosted: Mon Sep 12, 2011 8:22 pm 
Newbie

Joined: Mon Nov 26, 2007 2:30 am
Posts: 4
Location: New York
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.