Skip to content

Commit

Permalink
HHH-11965 - Fix cascade of one-to-one associations with proxies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Sep 29, 2017
1 parent 5a49cdc commit 00492a3
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -285,6 +285,15 @@ private static void cascadeLogicalOneToOneOrphanRemoval(
// useful for @OneToOne defined as FetchType.LAZY
loadedValue = eventSource.getPersistenceContext().unproxyAndReassociate( loadedValue );
valueEntry = eventSource.getPersistenceContext().getEntry( loadedValue );

// HHH-11965
// Should the unwrapped proxy value be equal via reference to the entity's property value
// provided by the 'child' variable, we should not trigger the orphan removal of the
// associated one-to-one.
if ( child == loadedValue ) {
// do nothing
return;
}
}

if ( valueEntry != null ) {
Expand Down

0 comments on commit 00492a3

Please sign in to comment.