-->
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: One to many bidirectional with subclass mapping
PostPosted: Tue Aug 02, 2011 6:06 am 
Newbie

Joined: Tue Aug 02, 2011 5:57 am
Posts: 1
Hi guys,

Hibernate newbie here.

I have class University with one to many relationship with class Student. Class Student has many to one with University.
I'd like Student to have a many to one rel with a subset of class University's fields, not all of them. For example I'd like Student to have a University reference which contains only the id and the name of the University.
For that I was thinking of creating first a BasicUniversity which contains the id and name and this class would be used in Student for the many to one rel. Then University would extend BasicUniversity and add other fields.

Do you consider this a good approach? Do you have other suggestions?

Thanks,
Cristian


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.