From d54f71f81c5066fa7e0fd1753f8d8d46a555525a Mon Sep 17 00:00:00 2001 From: Gavin King Date: Wed, 5 Jun 2024 08:08:12 +0200 Subject: [PATCH] HHH-6999 optimization don't need to run CHECK_ON_FLUSH with cascade=ALL, since ALL includes PERSIST_ON_FLUSH Signed-off-by: Gavin King --- .../src/main/java/org/hibernate/engine/spi/CascadeStyles.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 4d6e558739..c698a478ea 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 @@ -33,7 +33,7 @@ public final class CascadeStyles { public static final CascadeStyle ALL_DELETE_ORPHAN = new BaseCascadeStyle() { @Override public boolean doCascade(CascadingAction action) { - return true; + return action != CascadingActions.CHECK_ON_FLUSH; } @Override @@ -53,7 +53,7 @@ public final class CascadeStyles { public static final CascadeStyle ALL = new BaseCascadeStyle() { @Override public boolean doCascade(CascadingAction action) { - return true; + return action != CascadingActions.CHECK_ON_FLUSH; } @Override