use of org.hibernate.event.spi.DeleteEvent in project hibernate-orm by hibernate.
the class SessionImpl method delete.
@Override
public void delete(String entityName, Object object, boolean isCascadeDeleteEnabled, Set transientEntities) throws HibernateException {
checkOpenOrWaitingForAutoClose();
if (TRACE_ENABLED && persistenceContext.isRemovingOrphanBeforeUpates()) {
logRemoveOrphanBeforeUpdates("before continuing", entityName, object);
}
fireDelete(new DeleteEvent(entityName, object, isCascadeDeleteEnabled, persistenceContext.isRemovingOrphanBeforeUpates(), this), transientEntities);
if (TRACE_ENABLED && persistenceContext.isRemovingOrphanBeforeUpates()) {
logRemoveOrphanBeforeUpdates("after continuing", entityName, object);
}
}
use of org.hibernate.event.spi.DeleteEvent in project hibernate-orm by hibernate.
the class SessionImpl method delete.
// delete() operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
@Deprecated
public void delete(Object object) throws HibernateException {
checkOpen();
fireDelete(new DeleteEvent(object, this));
}
use of org.hibernate.event.spi.DeleteEvent in project BridgeServer2 by Sage-Bionetworks.
the class TagEventListenerTest method onDeleteWithTransientEntitiesNotTag.
@Test
public void onDeleteWithTransientEntitiesNotTag() throws HibernateException {
DeleteEvent event = new DeleteEvent(new HibernateAssessment(), null);
listener.onDelete(event, null);
verify(cacheProvider, never()).removeObject(CacheKey.tagList());
}
use of org.hibernate.event.spi.DeleteEvent in project BridgeServer2 by Sage-Bionetworks.
the class TagEventListenerTest method onDelete.
@Test
public void onDelete() throws HibernateException {
DeleteEvent event = new DeleteEvent(new Tag("value"), null);
listener.onDelete(event);
verify(cacheProvider).removeObject(CacheKey.tagList());
}
use of org.hibernate.event.spi.DeleteEvent in project BridgeServer2 by Sage-Bionetworks.
the class TagEventListenerTest method onDeleteNotTag.
@Test
public void onDeleteNotTag() throws HibernateException {
DeleteEvent event = new DeleteEvent(new HibernateAssessment(), null);
listener.onDelete(event);
verify(cacheProvider, never()).removeObject(CacheKey.tagList());
}
Aggregations