use of org.hibernate.envers.internal.synchronization.work.AddWorkUnit in project hibernate-orm by hibernate.
the class EnversPostInsertEventListenerImpl method onPostInsert.
@Override
public void onPostInsert(PostInsertEvent 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 AddWorkUnit(event.getSession(), event.getPersister().getEntityName(), getEnversService(), event.getId(), event.getPersister(), event.getState());
auditProcess.addWorkUnit(workUnit);
if (workUnit.containsWork()) {
generateBidirectionalCollectionChangeWorkUnits(auditProcess, event.getPersister(), entityName, event.getState(), null, event.getSession());
}
}
}
Aggregations