-->
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: Strategies with one-to-one parent-child
PostPosted: Sat Aug 27, 2011 3:37 pm 
Newbie

Joined: Sat Aug 27, 2011 1:25 pm
Posts: 1
Hello,

I've recently run into issues in project that I'm working on. We have optional one-to-ones, where there are cases of both PK and FK implementations of the join. The architecture of the application seems to assume a dependant parent-child relationship; that is, nulling the relationship on the left side should kill off the object on the right side.

Which means we have currently two entities in a one-to-one association with orphan-deletion. The strange thing is that I ran in to trouble when trying to upgrade Hibernate from 3.2.something to 3.6.7 -- everything has seemingly worked fine until now, yet I see orphan deletion on one-to-one did not arrive until 3.5. And now 3.6.7 gives me the exact same exception as complained about here https://hibernate.onjira.com/browse/HHH-5267.

So... it doesn't seem like I can get an orphan-deleting one-to-one working (been trying with both the Hibernate and the JPA2 annotation). The interesting point here is that the association is actually a component; the other-side is not really an entity that has an independent lifecycle.

So this opens up the door to doing some kind of a "joined-component" mapping; but I have been unable to figure out how to achieve it. It seems to me that the only component one-to-ones I might be able to achieve using annotations are genuinely embedded components; but these components reside in separate tables and would have to be joined in. These are also not "collections of components"... just your regular bidirectional one-to-one things.

Any ideas as to how to go about this? Googling shows that optional dependant one-to-one is a bit of a sore point for many...


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.