Search in sources :

Example 1 with PreCollectionRemoveEventListener

use of org.hibernate.event.spi.PreCollectionRemoveEventListener in project hibernate-orm by hibernate.

the class CollectionRemoveAction method preRemove.

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);
    }
}
Also used : PreCollectionRemoveEventListener(org.hibernate.event.spi.PreCollectionRemoveEventListener) PreCollectionRemoveEvent(org.hibernate.event.spi.PreCollectionRemoveEvent)

Example 2 with PreCollectionRemoveEventListener

use of org.hibernate.event.spi.PreCollectionRemoveEventListener in project hibernate-reactive by hibernate.

the class ReactiveCollectionRemoveAction method preRemove.

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);
    }
}
Also used : PreCollectionRemoveEventListener(org.hibernate.event.spi.PreCollectionRemoveEventListener) PreCollectionRemoveEvent(org.hibernate.event.spi.PreCollectionRemoveEvent)

Aggregations

PreCollectionRemoveEvent (org.hibernate.event.spi.PreCollectionRemoveEvent)2 PreCollectionRemoveEventListener (org.hibernate.event.spi.PreCollectionRemoveEventListener)2