Welcome,
All I need is all-delete-orphan semantics for one-to-one relationship.
I was looking for such a problem on this forum and I found 4 topics:
http://forum.hibernate.org/viewtopic.php?t=931506
http://forum.hibernate.org/viewtopic.php?t=925082
http://forum.hibernate.org/viewtopic.php?t=936167
http://forum.hibernate.org/viewtopic.php?t=933900
But no one of them brings me closer, to how to solve it in an elegant way.
In one of them is proposal of some work-around:
Quote:
As a work around use a bag/list/set/... on the one side and use cascade="all-delete-orphan"
If you prefer hide the fact of the collectino/array behind accessor methods which set/get only one instance into the collection/array.
But in some post Gavin wrote:
Quote:
Actually, I suppose that orphan-delete for one-to-one could be implemented.
Honestly I prefer the second solution, but as far as I know it is unavaible. Is there any chance it would be? (should I open some JIRA issue?)
Maybe there is another more elegant solution then work-around with bag/list/set/... ?
Any help would be apprieciated.
Greetings,
Mikolaj Kmita
Hibernate version: 2.1.6