use of org.hibernate.event.spi.PreDeleteEvent in project gorm-hibernate5 by grails.
the class ClosureEventTriggeringInterceptor method onPreDelete.
public boolean onPreDelete(PreDeleteEvent hibernateEvent) {
AbstractPersistenceEvent event = new org.grails.datastore.mapping.engine.event.PreDeleteEvent(this.datastore, hibernateEvent.getEntity());
publishEvent(hibernateEvent, event);
return event.isCancelled();
}
use of org.hibernate.event.spi.PreDeleteEvent in project hibernate-orm by hibernate.
the class EntityDeleteAction method preDelete.
protected boolean preDelete() {
boolean veto = false;
final EventListenerGroup<PreDeleteEventListener> listenerGroup = getFastSessionServices().eventListenerGroup_PRE_DELETE;
if (listenerGroup.isEmpty()) {
return veto;
}
final PreDeleteEvent event = new PreDeleteEvent(getInstance(), getId(), state, getPersister(), eventSource());
for (PreDeleteEventListener listener : listenerGroup.listeners()) {
veto |= listener.onPreDelete(event);
}
return veto;
}
Aggregations