HHH-18140 Skip optimizeUnloadedDelete if there are POST_COMMIT_DELETE listeners

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-05-20 15:34:10 +02:00 committed by Christian Beikov
parent c5893e7919
commit fc30edd221
1 changed files with 1 additions and 0 deletions

View File

@ -273,6 +273,7 @@ public class DefaultDeleteEventListener implements DeleteEventListener, Callback
// Bean Validation adds a PRE_DELETE listener
// and Envers adds a POST_DELETE listener
return fss.eventListenerGroup_PRE_DELETE.count() > 0
|| fss.eventListenerGroup_POST_COMMIT_DELETE.count() > 0
|| fss.eventListenerGroup_POST_DELETE.count() > 1
|| fss.eventListenerGroup_POST_DELETE.count() == 1
&& !(fss.eventListenerGroup_POST_DELETE.listeners().iterator().next()