From ef3550eed5bac8bf4f6298493a9d771851843367 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Wed, 26 Nov 2014 15:25:42 -0800 Subject: [PATCH] HHH-9330 : orphanRemoval=true does not work in bidirectional relationships (without cascading) --- .../src/main/java/org/hibernate/engine/spi/CascadeStyles.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadeStyles.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadeStyles.java index be4ed381aa..8eacfbf9f0 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadeStyles.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/CascadeStyles.java @@ -205,7 +205,9 @@ public class CascadeStyles { public static final CascadeStyle DELETE_ORPHAN = new BaseCascadeStyle() { @Override public boolean doCascade(CascadingAction action) { - return action == CascadingActions.DELETE || action == CascadingActions.SAVE_UPDATE; + return action == CascadingActions.DELETE || + action == CascadingActions.SAVE_UPDATE || + action == CascadingActions.PERSIST_ON_FLUSH; } @Override