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.  [ 2 posts ] 
Author Message
 Post subject: map multiple objects to a single field?
PostPosted: Sun Aug 12, 2007 6:06 am 
Newbie

Joined: Thu Jul 26, 2007 5:12 am
Posts: 14
Location: Nepal
can we map multiple objects to a single field??
suppose i have a table ->
Code:
ID   userID    userType
1        1          student
2        2          student
3        1          teacher
4        2          teacher


Pojo
Long ID
Student student
Teacher teacher

I want to map the userID to student if the userType is stduent and map to teacher if the userType is teacher.

_________________
:: there are 10 types of people in this world...1 who understands binary and the other 1 who does not ::


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 12, 2007 8:20 am 
Beginner
Beginner

Joined: Wed Sep 21, 2005 8:18 am
Posts: 31
if you inherit Student and Teacher class through a common class say Person and use class per hierarchy strategy, then you can achieve results which you want.

_________________
amer sohail


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

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.