-->
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.  [ 3 posts ] 
Author Message
 Post subject: Polymorphic association in Hibernate
PostPosted: Wed Jan 26, 2005 8:21 am 
Newbie

Joined: Wed Jan 26, 2005 8:05 am
Posts: 13
Hi guys,
I have a question about the polymorphic associations in Hibernate.

Imagine I have an object, that contains a set of objects implementing the
same interface but being mapped to different tables. They have absolutly different properties.
These objects are declared as entities in Hibernate. having their own life cycle. So they can not be mapped as component.

So I would like to have only one Set property in the parent object, and this
Set contain different Objects from different tables,
having the same super interface.

I do not want to have several Set properties in my parent object corresponding to each different child object.

Is there a way to do this with the Hibernate mapping xml file ?
Any suggestions and ideas are welcome.

Thank you.
Skyrose.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 8:27 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
with H2, look at, there are limitations
http://www.hibernate.org/hib_docs/refer ... tance.html

or play with hibernate 3 union subclass strategy, this is what you need

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 9:42 am 
Newbie

Joined: Wed Jan 26, 2005 8:05 am
Posts: 13
Hello Antony,
Thank you very much for your reply.

Skyrose.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.