Search in sources :

Example 1 with DelWorkUnit

use of org.hibernate.envers.internal.synchronization.work.DelWorkUnit in project hibernate-orm by hibernate.

the class EnversPostDeleteEventListenerImpl method onPostDelete.

@Override
public void onPostDelete(PostDeleteEvent event) {
    final String entityName = event.getPersister().getEntityName();
    if (getEnversService().getEntitiesConfigurations().isVersioned(entityName)) {
        checkIfTransactionInProgress(event.getSession());
        final AuditProcess auditProcess = getEnversService().getAuditProcessManager().get(event.getSession());
        final AuditWorkUnit workUnit = new DelWorkUnit(event.getSession(), event.getPersister().getEntityName(), getEnversService(), event.getId(), event.getPersister(), event.getDeletedState());
        auditProcess.addWorkUnit(workUnit);
        if (workUnit.containsWork()) {
            generateBidirectionalCollectionChangeWorkUnits(auditProcess, event.getPersister(), entityName, null, event.getDeletedState(), event.getSession());
        }
    }
}
Also used : AuditProcess(org.hibernate.envers.internal.synchronization.AuditProcess) DelWorkUnit(org.hibernate.envers.internal.synchronization.work.DelWorkUnit) AuditWorkUnit(org.hibernate.envers.internal.synchronization.work.AuditWorkUnit)

Aggregations

AuditProcess (org.hibernate.envers.internal.synchronization.AuditProcess)1 AuditWorkUnit (org.hibernate.envers.internal.synchronization.work.AuditWorkUnit)1 DelWorkUnit (org.hibernate.envers.internal.synchronization.work.DelWorkUnit)1