@@ -294,7 +294,7 @@ private void recreateCollections(Object entity, Object id, EntityPersister persi
294294 forEachOwnedCollection ( entity , id , persister ,
295295 (descriptor , collection ) -> {
296296 final String role = descriptor .getRole ();
297- firePreRecreate ( collection , id , entityName , entity );
297+ firePreRecreate ( descriptor , collection , id , entityName , entity );
298298 final var event = eventMonitor .beginCollectionRecreateEvent ();
299299 boolean success = false ;
300300 try {
@@ -307,7 +307,7 @@ private void recreateCollections(Object entity, Object id, EntityPersister persi
307307 if ( statistics .isStatisticsEnabled () ) {
308308 statistics .recreateCollection ( role );
309309 }
310- firePostRecreate ( collection , id , entityName , entity );
310+ firePostRecreate ( descriptor , collection , id , entityName , entity );
311311 } );
312312 }
313313 }
@@ -371,7 +371,7 @@ private void removeCollections(Object entity, Object id, EntityPersister persist
371371 forEachOwnedCollection ( entity , id , persister ,
372372 (descriptor , collection ) -> {
373373 final String role = descriptor .getRole ();
374- firePreRemove ( collection , id , entityName , entity );
374+ firePreRemove ( descriptor , collection , id , entityName , entity );
375375 final DiagnosticEvent event = eventMonitor .beginCollectionRemoveEvent ();
376376 boolean success = false ;
377377 try {
@@ -381,7 +381,7 @@ private void removeCollections(Object entity, Object id, EntityPersister persist
381381 finally {
382382 eventMonitor .completeCollectionRemoveEvent ( event , id , role , success , this );
383383 }
384- firePostRemove ( collection , id , entityName , entity );
384+ firePostRemove ( descriptor , collection , id , entityName , entity );
385385 if ( statistics .isStatisticsEnabled () ) {
386386 statistics .removeCollection ( role );
387387 }
@@ -459,7 +459,7 @@ private void removeAndRecreateCollections(Object entity, Object id, EntityPersis
459459 forEachOwnedCollection ( entity , id , persister ,
460460 (descriptor , collection ) -> {
461461 final String role = descriptor .getRole ();
462- firePreUpdate ( collection , id , entityName , entity );
462+ firePreUpdate ( descriptor , collection , id , entityName , entity );
463463 final DiagnosticEvent event = eventMonitor .beginCollectionRemoveEvent ();
464464 boolean success = false ;
465465 try {
@@ -471,7 +471,7 @@ private void removeAndRecreateCollections(Object entity, Object id, EntityPersis
471471 finally {
472472 eventMonitor .completeCollectionRemoveEvent ( event , id , role , success , this );
473473 }
474- firePostUpdate ( collection , id , entityName , entity );
474+ firePostUpdate ( descriptor , collection , id , entityName , entity );
475475 if ( statistics .isStatisticsEnabled () ) {
476476 statistics .updateCollection ( role );
477477 }
@@ -668,44 +668,74 @@ protected void firePostDelete(Object entity, Object id, EntityPersister persiste
668668 }
669669
670670 // Hibernate Reactive may need to call this
671- protected void firePreRecreate (PersistentCollection <?> collection , Object id , String entityName , Object owner ) {
671+ protected void firePreRecreate (
672+ CollectionPersister collectionPersister ,
673+ PersistentCollection <?> collection ,
674+ Object id ,
675+ String entityName ,
676+ Object owner ) {
672677 eventListenerGroups .eventListenerGroup_PRE_COLLECTION_RECREATE .fireLazyEventOnEachListener (
673- () -> new PreCollectionRecreateEvent ( collection , id , entityName , owner ),
678+ () -> new PreCollectionRecreateEvent ( collectionPersister , collection , id , entityName , owner ),
674679 PreCollectionRecreateEventListener ::onPreRecreateCollection );
675680 }
676681
677682 // Hibernate Reactive may need to call this
678- protected void firePreUpdate (PersistentCollection <?> collection , Object id , String entityName , Object owner ) {
683+ protected void firePreUpdate (
684+ CollectionPersister collectionPersister ,
685+ PersistentCollection <?> collection ,
686+ Object id ,
687+ String entityName ,
688+ Object owner ) {
679689 eventListenerGroups .eventListenerGroup_PRE_COLLECTION_UPDATE .fireLazyEventOnEachListener (
680- () -> new PreCollectionUpdateEvent ( collection , id , entityName , owner ),
690+ () -> new PreCollectionUpdateEvent ( collectionPersister , collection , id , entityName , owner ),
681691 PreCollectionUpdateEventListener ::onPreUpdateCollection );
682692 }
683693
684694 // Hibernate Reactive may need to call this
685- protected void firePreRemove (PersistentCollection <?> collection , Object id , String entityName , Object owner ) {
695+ protected void firePreRemove (
696+ CollectionPersister collectionPersister ,
697+ PersistentCollection <?> collection ,
698+ Object id ,
699+ String entityName ,
700+ Object owner ) {
686701 eventListenerGroups .eventListenerGroup_PRE_COLLECTION_REMOVE .fireLazyEventOnEachListener (
687- () -> new PreCollectionRemoveEvent ( collection , id , entityName , owner ),
702+ () -> new PreCollectionRemoveEvent ( collectionPersister , collection , id , entityName , owner ),
688703 PreCollectionRemoveEventListener ::onPreRemoveCollection );
689704 }
690705
691706 // Hibernate Reactive may need to call this
692- protected void firePostRecreate (PersistentCollection <?> collection , Object id , String entityName , Object owner ) {
707+ protected void firePostRecreate (
708+ CollectionPersister collectionPersister ,
709+ PersistentCollection <?> collection ,
710+ Object id ,
711+ String entityName ,
712+ Object owner ) {
693713 eventListenerGroups .eventListenerGroup_POST_COLLECTION_RECREATE .fireLazyEventOnEachListener (
694- () -> new PostCollectionRecreateEvent ( collection , id , entityName , owner ),
714+ () -> new PostCollectionRecreateEvent ( collectionPersister , collection , id , entityName , owner ),
695715 PostCollectionRecreateEventListener ::onPostRecreateCollection );
696716 }
697717
698718 // Hibernate Reactive may need to call this
699- protected void firePostUpdate (PersistentCollection <?> collection , Object id , String entityName , Object owner ) {
719+ protected void firePostUpdate (
720+ CollectionPersister collectionPersister ,
721+ PersistentCollection <?> collection ,
722+ Object id ,
723+ String entityName ,
724+ Object owner ) {
700725 eventListenerGroups .eventListenerGroup_POST_COLLECTION_UPDATE .fireLazyEventOnEachListener (
701- () -> new PostCollectionUpdateEvent ( collection , id , entityName , owner ),
726+ () -> new PostCollectionUpdateEvent ( collectionPersister , collection , id , entityName , owner ),
702727 PostCollectionUpdateEventListener ::onPostUpdateCollection );
703728 }
704729
705730 // Hibernate Reactive may need to call this
706- protected void firePostRemove (PersistentCollection <?> collection , Object id , String entityName , Object owner ) {
731+ protected void firePostRemove (
732+ CollectionPersister collectionPersister ,
733+ PersistentCollection <?> collection ,
734+ Object id ,
735+ String entityName ,
736+ Object owner ) {
707737 eventListenerGroups .eventListenerGroup_POST_COLLECTION_REMOVE .fireLazyEventOnEachListener (
708- () -> new PostCollectionRemoveEvent ( collection , id , entityName , owner ),
738+ () -> new PostCollectionRemoveEvent ( collectionPersister , collection , id , entityName , owner ),
709739 PostCollectionRemoveEventListener ::onPostRemoveCollection );
710740 }
711741
0 commit comments