Java 类org.hibernate.event.spi.PostDeleteEvent 实例源码

项目:lams    文件:EntityDeleteAction.java   
private void postDelete() {
    final EventListenerGroup<PostDeleteEventListener> listenerGroup = listenerGroup( EventType.POST_DELETE );
    if ( listenerGroup.isEmpty() ) {
        return;
    }
    final PostDeleteEvent event = new PostDeleteEvent(
            getInstance(),
            getId(),
            state,
            getPersister(),
            eventSource()
    );
    for ( PostDeleteEventListener listener : listenerGroup.listeners() ) {
        listener.onPostDelete( event );
    }
}
项目:mojito    文件:EntityCrudEventListener.java   
@Override
public void onPostDelete(PostDeleteEvent event) {
    Repository repository = null;
    Object entity = event.getEntity();

    if (entity instanceof RepositoryLocale) {
        RepositoryLocale repositoryLocale = (RepositoryLocale) entity;
        repository = repositoryLocale.getRepository();
        logger.debug("Repository statistics is outdated because locale is deleted");
    } else if (entity instanceof TMTextUnitCurrentVariant) {
        TMTextUnitCurrentVariant tmTextUnitCurrentVariant = (TMTextUnitCurrentVariant) entity;
        repository = tmTextUnitCurrentVariant.getTmTextUnit().getAsset().getRepository();
        logger.debug("Repository statistics is outdated because translation is deleted");
    }

    setRepositoryStatistisOutOfDate(repository);
}
项目:Hibernate-Search-GenericJPA    文件:HibernateUpdateSource.java   
@Override
public void onPostDelete(PostDeleteEvent event) {
    if ( disabled ) {
        return;
    }

    final Object entity = event.getEntity();
    if ( getDocumentBuilder( entity ) != null ) {
        // FIXME The engine currently needs to know about details such as identifierRollbackEnabled
        // but we should not move the responsibility to figure out the proper id to the engine
        boolean identifierRollbackEnabled = event.getSession()
                .getFactory()
                .getSettings()
                .isIdentifierRollbackEnabled();
        processWork(
                entity,
                event.getId(),
                WorkType.DELETE,
                event,
                identifierRollbackEnabled
        );
    }
}
项目:lams    文件:EntityDeleteAction.java   
private void postCommitDelete(boolean success) {
    final EventListenerGroup<PostDeleteEventListener> listenerGroup = listenerGroup( EventType.POST_COMMIT_DELETE );
    if ( listenerGroup.isEmpty() ) {
        return;
    }
    final PostDeleteEvent event = new PostDeleteEvent(
            getInstance(),
            getId(),
            state,
            getPersister(),
            eventSource()
    );
    for ( PostDeleteEventListener listener : listenerGroup.listeners() ) {
        if ( PostCommitDeleteEventListener.class.isInstance( listener ) ) {
            if ( success ) {
                listener.onPostDelete( event );
            }
            else {
                ((PostCommitDeleteEventListener) listener).onPostDeleteCommitFailed( event );
            }
        }
        else {
            //default to the legacy implementation that always fires the event
            listener.onPostDelete( event );
        }
    }
}
项目:cibet    文件:CibetPostDeleteEventListener.java   
@Override
public void onPostDelete(PostDeleteEvent event) {
   if (!Context.internalRequestScope().isAuditedByEnvers()) {
      String entityName = event.getPersister().getEntityName();
      log.debug(entityName + " not audited by Cibet configuration");
      return;
   }
   super.onPostDelete(event);
}
项目:dhis2-core    文件:DeletedObjectPostDeleteEventListener.java   
@Override
public void onPostDelete( PostDeleteEvent event )
{
    if ( MetadataObject.class.isInstance( event.getEntity() ) )
    {
        IdentifiableObject identifiableObject = (IdentifiableObject) event.getEntity();
        DeletedObject deletedObject = new DeletedObject( identifiableObject );
        deletedObject.setDeletedBy( getUsername() );

        event.getSession().persist( deletedObject );
    }
}
项目:bygle-ldp    文件:DBEventDeleteListener.java   
@Override
public void onPostDelete(PostDeleteEvent arg0) {
    if(arg0.getEntity() instanceof Records){
        Records records = (Records)arg0.getEntity();
        try {
            if(records.getRecordTypes().getIdRecordType()!=BygleSystemUtils.RESOURCE_TYPE_BINARY){
                EndPointManagerInterface endPointManager = endPointManagerProvider.getEndPointManager();
                endPointManager.dePublishRecord(records.getRdf(),records.getRdfAbout(),records.getHost());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
项目:ix3    文件:EventListenerImplRuleEngine.java   
@Override
public void onPostDelete(PostDeleteEvent pde) {
    autowired();
    EntityMode entityMode = pde.getPersister().getEntityMode();

    RuleContext ruleContext = new RuleContextImplNoPrincipal(pde.getEntity(), null);

    fireRules(ruleContext, pde.getPersister(), null, entityMode, RuleGroupPredefined.PostDelete.class, RuleGroupPredefined.PostInsertOrUpdateOrDelete.class, RuleGroupPredefined.PostUpdateOrDelete.class);
}
项目:lams    文件:CollectionCacheInvalidator.java   
@Override
public void onPostDelete(PostDeleteEvent event) {
    evictCache( event.getEntity(), event.getPersister(), event.getSession(), null );
}
项目:rpb    文件:AuditLogListener.java   
@Override
public void onPostDelete(PostDeleteEvent event) {
    audit(event, Deletion, event.getEntity());
}
项目:mojito    文件:EntityCrudEventListener.java   
@Override
public void onPostDeleteCommitFailed(PostDeleteEvent pde) {
}
项目:Audit4j-Hibernate    文件:AuditPostDeleteEventListenerImpl.java   
@Override
public void onPostDelete(PostDeleteEvent event) {
    AuditManager.getInstance().audit(new EventBuilder()
            .addAction("delete " + event.getEntity().getClass().toString())
            .addField(event.getEntity().getClass().toString(), event.getEntity()).build());
}
项目:rpb    文件:AuditLogListener.java   
@Override
public void onPostDelete(PostDeleteEvent event) {
    audit(event, Deletion, event.getEntity());
}
项目:AgileAlligators    文件:HibernateEventListenerWiring.java   
@Override
public void onPostDelete( PostDeleteEvent event )
{
    updateIdentifiableObjects();
}
项目:spring-entity-listener    文件:HibernateEntityListenersAdapter.java   
/**
 * @see org.hibernate.event.spi.PostDeleteEventListener#onPostDelete(org.hibernate
 *      .event.spi.PostDeleteEvent)
 */
@Override
public void onPostDelete(PostDeleteEvent event) {
    execute(postRemove, event.getEntity());
}
项目:jersey2-toolkit    文件:HibernateSessionFactoryFactoryTest.java   
@Override
public void onPostDelete(final PostDeleteEvent event) {

}
项目:jersey2-toolkit    文件:HibernateSessionFactoryFactoryTest.java   
@Override
public void onPostDeleteCommitFailed(final PostDeleteEvent event) {

}