public PreCollectionRemoveEvent(CollectionPersister collectionPersister, PersistentCollection collection, EventSource source, Object loadedOwner) { super( collectionPersister, collection, source, loadedOwner, getOwnerIdOrNull( loadedOwner, source ) ); } }
private void preRemove() { final EventListenerGroup<PreCollectionRemoveEventListener> listenerGroup = listenerGroup( EventType.PRE_COLLECTION_REMOVE ); if ( listenerGroup.isEmpty() ) { return; } final PreCollectionRemoveEvent event = new PreCollectionRemoveEvent( getPersister(), getCollection(), eventSource(), affectedOwner ); for ( PreCollectionRemoveEventListener listener : listenerGroup.listeners() ) { listener.onPreRemoveCollection( event ); } }
@Override public void onPreRemoveCollection(PreCollectionRemoveEvent event) { final CollectionEntry collectionEntry = getCollectionEntry( event ); if ( collectionEntry != null ) { if ( !collectionEntry.getLoadedPersister().isInverse() ) { Serializable oldColl = collectionEntry.getSnapshot(); if ( !event.getCollection().wasInitialized() && shouldGenerateRevision( event ) ) { // In case of uninitialized collection we need a fresh snapshot to properly calculate audit data. oldColl = initializeCollection( event ); } onCollectionAction( event, null, oldColl, collectionEntry ); } else { // HHH-7510 - Avoid LazyInitializationException when global_with_modified_flag = true if ( getEnversService().getGlobalConfiguration().isGlobalWithModifiedFlag() ) { initializeCollection( event ); } } } } }
private void preRemove() { EventListenerGroup<PreCollectionRemoveEventListener> listenerGroup = listenerGroup( EventType.PRE_COLLECTION_REMOVE ); if ( listenerGroup.isEmpty() ) { return; } final PreCollectionRemoveEvent event = new PreCollectionRemoveEvent( getPersister(), getCollection(), eventSource(), affectedOwner ); for ( PreCollectionRemoveEventListener listener : listenerGroup.listeners() ) { listener.onPreRemoveCollection( event ); } }
@Override public void onPreRemoveCollection(PreCollectionRemoveEvent event) { final CollectionEntry collectionEntry = getCollectionEntry( event ); if ( collectionEntry != null ) { if ( !collectionEntry.getLoadedCollectionDescriptor().isInverse() ) { Serializable oldColl = collectionEntry.getSnapshot(); if ( !event.getCollection().wasInitialized() && shouldGenerateRevision( event ) ) { // In case of uninitialized collection we need a fresh snapshot to properly calculate audit data. oldColl = initializeCollection( event ); } onCollectionAction( event, null, oldColl, collectionEntry ); } else { // HHH-7510 - Avoid LazyInitializationException when global_with_modified_flag = true if ( getAuditService().getOptions().isGlobalWithModifiedFlagEnabled() ) { initializeCollection( event ); } } } } }
public PreCollectionRemoveEvent(CollectionPersister collectionPersister, PersistentCollection collection, EventSource source, Object loadedOwner) { super( collectionPersister, collection, source, loadedOwner, getOwnerIdOrNull( loadedOwner, source ) ); } }
private void preRemove() { EventListenerGroup<PreCollectionRemoveEventListener> listenerGroup = listenerGroup( EventType.PRE_COLLECTION_REMOVE ); if ( listenerGroup.isEmpty() ) { return; } final PreCollectionRemoveEvent event = new PreCollectionRemoveEvent( getPersister(), getCollection(), eventSource(), affectedOwner ); for ( PreCollectionRemoveEventListener listener : listenerGroup.listeners() ) { listener.onPreRemoveCollection( event ); } }
public PreCollectionRemoveEvent(CollectionPersister collectionPersister, PersistentCollection collection, EventSource source, Object loadedOwner) { super( collectionPersister, collection, source, loadedOwner, getOwnerIdOrNull( loadedOwner, source ) ); } }
private void preRemove() { final EventListenerGroup<PreCollectionRemoveEventListener> listenerGroup = listenerGroup( EventType.PRE_COLLECTION_REMOVE ); if ( listenerGroup.isEmpty() ) { return; } final PreCollectionRemoveEvent event = new PreCollectionRemoveEvent( getPersistentCollectionDescriptor(), getCollection(), eventSource(), affectedOwner ); for ( PreCollectionRemoveEventListener listener : listenerGroup.listeners() ) { listener.onPreRemoveCollection( event ); } }
public PreCollectionRemoveEvent( PersistentCollectionDescriptor collectionDescriptor, PersistentCollection collection, EventSource source, Object loadedOwner) { super( collectionDescriptor, collection, source, loadedOwner, getOwnerIdOrNull( loadedOwner, source ) ); } }