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...