-->
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: Is this possible in hibernate
PostPosted: Wed Apr 05, 2006 7:09 pm 
Newbie

Joined: Fri Mar 31, 2006 11:35 pm
Posts: 2
Hi,

is it possible to have a polymorphic one to many relationship whereby the hibernate objects in the collection on the many side share the same interface, but these hibernate instances do not belong to the same class hierarchy?

thanks,

Dean


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 05, 2006 10:36 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
deanc wrote:
is it possible to have <snip> the hibernate objects in the collection on the many side share the same interface, but these hibernate instances do not belong to the same class hierarchy?

No. Mappings are by class, so unless you're going to map Object, there is no mapping that will capture objects in different class hierarchies.

deanc wrote:
a polymorphic one to many relationship

What's that? Polymorphism describes things that related at the class level, not between objects, so there's no "one to many" aspect. To use the common example of company employees, either a SoftwareDeveloper is-a Employee (polymorphic relationship), or an Employee has-a SoftwareDeveloper role (many-to-one relationship). I don't think that the expression "polymorphic one to many" means anything.


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.