Code example for PostDeleteEvent

Methods: getDeletedStategetIdgetPersister, getSession

0
		super( enversConfiguration );
	} 
 
	@Override 
	public void onPostDelete(PostDeleteEvent event) {
        String entityName = event.getPersister().getEntityName();
 
        if ( getAuditConfiguration().getEntCfg().isVersioned( entityName ) ) {
            AuditProcess auditProcess = getAuditConfiguration().getSyncManager().get( event.getSession() );
 
            AuditWorkUnit workUnit = new DelWorkUnit(
					event.getSession(),
					event.getPersister().getEntityName(),
					getAuditConfiguration(), 
                    event.getId(),
					event.getPersister(),
					event.getDeletedState()
			); 
            auditProcess.addWorkUnit( workUnit );
 
            if ( workUnit.containsWork() ) {
                generateBidirectionalCollectionChangeWorkUnits( 
						auditProcess,
						event.getPersister(),
						entityName,
						null, 
                        event.getDeletedState(),
						event.getSession()
				); 
			} 
		} 
	} 
} 
Experience pair programming with AI  Get Codota for Java