-->
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 it possible to map polymorphic components
PostPosted: Thu Jul 22, 2004 4:39 am 
Newbie

Joined: Wed Feb 11, 2004 5:08 am
Posts: 14
As I'm still strugling with my problem from thread posted previously I tried to change my strategy.

Now I'm trying to create an abstract CustomerName object which would then be implemented as PersonName and CompanyName. As I'm mapping my both customers to the same table (table per class hierarchy strategy) it would be nice to be able to map the names of the customers also as components to the same table.

So the question is that is it possible to map inherited components in any way with Hibernate?


-Jouni Hartikainen


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 22, 2004 10:15 am 
Beginner
Beginner

Joined: Tue Jun 29, 2004 3:44 pm
Posts: 43
I was looking in to this yesterday, and although I'm very new to Hibernate, I don't believe it's possible.

For now, I've created a many-to-one mapping from my owner class to owned class. Unfortunately, because many-to-one cannot use "all-delete-orphan" the program is leaving many, many useless objects behind in the DB. I cannot use a one-to-one mapping because the owned class cannot have a property referring to the owner class because of package restrictions.

Perhaps someone else can shed some light on better ways to do this. Or at least provide the hope that v3 will allow a subclassed component or unidirectional one-to-one.


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.