当前位置: 首页>>代码示例>>Java>>正文


Java PostInsertEvent类代码示例

本文整理汇总了Java中org.hibernate.event.spi.PostInsertEvent的典型用法代码示例。如果您正苦于以下问题:Java PostInsertEvent类的具体用法?Java PostInsertEvent怎么用?Java PostInsertEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PostInsertEvent类属于org.hibernate.event.spi包,在下文中一共展示了PostInsertEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: postInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
private void postInsert() {
	final EventListenerGroup<PostInsertEventListener> listenerGroup = listenerGroup( EventType.POST_INSERT );
	if ( listenerGroup.isEmpty() ) {
		return;
	}
	final PostInsertEvent event = new PostInsertEvent(
			getInstance(),
			getId(),
			getState(),
			getPersister(),
			eventSource()
	);
	for ( PostInsertEventListener listener : listenerGroup.listeners() ) {
		listener.onPostInsert( event );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:EntityInsertAction.java

示例2: postInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
private void postInsert() {
	if ( isDelayed ) {
		getSession().getPersistenceContext().replaceDelayedEntityIdentityInsertKeys( delayedEntityKey, generatedId );
	}

	final EventListenerGroup<PostInsertEventListener> listenerGroup = listenerGroup( EventType.POST_INSERT );
	if ( listenerGroup.isEmpty() ) {
		return;
	}
	final PostInsertEvent event = new PostInsertEvent(
			getInstance(),
			generatedId,
			getState(),
			getPersister(),
			eventSource()
	);
	for ( PostInsertEventListener listener : listenerGroup.listeners() ) {
		listener.onPostInsert( event );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:EntityIdentityInsertAction.java

示例3: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent 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 added");
    } else if (entity instanceof TMTextUnitVariant) {
        TMTextUnitVariant tmTextUnitVariant = (TMTextUnitVariant) entity;
        TMTextUnit tmTextUnit = tmTextUnitVariant.getTmTextUnit();
        repository = tmTextUnit.getAsset().getRepository();
        logger.debug("Repository statistics is outdated because string/translation is added");
    }

    setRepositoryStatistisOutOfDate(repository);
}
 
开发者ID:box,项目名称:mojito,代码行数:19,代码来源:EntityCrudEventListener.java

示例4: postCommitInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
private void postCommitInsert(boolean success) {
	final EventListenerGroup<PostInsertEventListener> listenerGroup = listenerGroup( EventType.POST_COMMIT_INSERT );
	if ( listenerGroup.isEmpty() ) {
		return;
	}
	final PostInsertEvent event = new PostInsertEvent(
			getInstance(),
			getId(),
			getState(),
			getPersister(),
			eventSource()
	);
	for ( PostInsertEventListener listener : listenerGroup.listeners() ) {
		if ( PostCommitInsertEventListener.class.isInstance( listener ) ) {
			if ( success ) {
				listener.onPostInsert( event );
			}
			else {
				((PostCommitInsertEventListener) listener).onPostInsertCommitFailed( event );
			}
		}
		else {
			//default to the legacy implementation that always fires the event
			listener.onPostInsert( event );
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:EntityInsertAction.java

示例5: postCommitInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
private void postCommitInsert(boolean success) {
	final EventListenerGroup<PostInsertEventListener> listenerGroup = listenerGroup( EventType.POST_COMMIT_INSERT );
	if ( listenerGroup.isEmpty() ) {
		return;
	}
	final PostInsertEvent event = new PostInsertEvent(
			getInstance(),
			generatedId,
			getState(),
			getPersister(),
			eventSource()
	);
	for ( PostInsertEventListener listener : listenerGroup.listeners() ) {
		if ( PostCommitInsertEventListener.class.isInstance( listener ) ) {
			if ( success ) {
				listener.onPostInsert( event );
			}
			else {
				((PostCommitInsertEventListener) listener).onPostInsertCommitFailed( event );
			}
		}
		else {
			//default to the legacy implementation that always fires the event
			listener.onPostInsert( event );
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:EntityIdentityInsertAction.java

示例6: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
    // TODO
    // Repository check, get from Audit annotation, get from entoity table
    // name.

    if (event.getEntity().getClass().isAnnotationPresent(Audit.class)) {
        if (event.getEntity().getClass().isAnnotationPresent(Table.class)) {
            
        }
        AuditManager.getInstance().audit(new EventBuilder()
                .addAction("save " + event.getEntity().getClass().toString())
                .addField(event.getEntity().getClass().toString(), event.getEntity()).build());
    }
}
 
开发者ID:nipunthathsara,项目名称:Audit4j-Hibernate,代码行数:16,代码来源:AuditPostInsertEventListenerImpl.java

示例7: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
public void onPostInsert(PostInsertEvent event) {
   String entityName = event.getPersister().getEntityName();
   if (!Context.internalRequestScope().isAuditedByEnvers()) {
      log.debug(entityName + " NOT audited by Cibet configuration");
      return;
   } else {
      log.debug(entityName + " audited by Cibet configuration");
   }

   super.onPostInsert(event);
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:12,代码来源:CibetPostInsertEventListener.java

示例8: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent 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.publishRecord(records.getRdf(), records.getRdfAbout(), records.getHost());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}
 
开发者ID:regestaexe,项目名称:bygle-ldp,代码行数:16,代码来源:DBEventInsertListener.java

示例9: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
	if ( disabled ) {
		return;
	}

	final Object entity = event.getEntity();
	if ( getDocumentBuilder( entity ) != null ) {
		Serializable id = event.getId();
		processWork( entity, id, WorkType.ADD, event, false );
	}
}
 
开发者ID:Hotware,项目名称:Hibernate-Search-GenericJPA,代码行数:13,代码来源:HibernateUpdateSource.java

示例10: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
	evictCache( event.getEntity(), event.getPersister(), event.getSession(), null );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:CollectionCacheInvalidator.java

示例11: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
    audit(event, Creation, event.getEntity());
}
 
开发者ID:ddRPB,项目名称:rpb,代码行数:5,代码来源:AuditLogListener.java

示例12: onPostInsertCommitFailed

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsertCommitFailed(PostInsertEvent pie) {
}
 
开发者ID:box,项目名称:mojito,代码行数:4,代码来源:EntityCrudEventListener.java

示例13: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert(PostInsertEvent event) {
  // Do Nothing
}
 
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:5,代码来源:EmptyEnversPostInsertEventListenerImpl.java

示例14: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
@Override
public void onPostInsert( PostInsertEvent event )
{
    updateIdentifiableObjects();
}
 
开发者ID:ehatle,项目名称:AgileAlligators,代码行数:6,代码来源:HibernateEventListenerWiring.java

示例15: onPostInsert

import org.hibernate.event.spi.PostInsertEvent; //导入依赖的package包/类
/**
 * @see org.hibernate.event.spi.PostInsertEventListener#onPostInsert(org.hibernate
 *      .event.spi.PostInsertEvent)
 */
@Override
public void onPostInsert(PostInsertEvent event) {
    execute(postInsert, event.getEntity());
}
 
开发者ID:beargiles,项目名称:spring-entity-listener,代码行数:9,代码来源:HibernateEntityListenersAdapter.java


注:本文中的org.hibernate.event.spi.PostInsertEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。