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


Java PostCommitUpdateEventListener类代码示例

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


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

示例1: PostCommitEventListenerGroupImpl

import org.hibernate.event.spi.PostCommitUpdateEventListener; //导入依赖的package包/类
public PostCommitEventListenerGroupImpl(EventType<T> eventType) {
	super( eventType );

	if ( eventType == EventType.POST_COMMIT_DELETE ) {
		this.extendedListenerContract = PostCommitDeleteEventListener.class;
	}
	else if ( eventType == EventType.POST_COMMIT_INSERT ) {
		this.extendedListenerContract = PostCommitInsertEventListener.class;
	}
	else if ( eventType == EventType.POST_COMMIT_UPDATE ) {
		this.extendedListenerContract = PostCommitUpdateEventListener.class;
	}
	else {
		throw new IllegalStateException( "Unexpected usage of PostCommitEventListenerGroupImpl" );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:PostCommitEventListenerGroupImpl.java

示例2: postCommitUpdate

import org.hibernate.event.spi.PostCommitUpdateEventListener; //导入依赖的package包/类
private void postCommitUpdate(boolean success) {
	final EventListenerGroup<PostUpdateEventListener> listenerGroup = listenerGroup( EventType.POST_COMMIT_UPDATE );
	if ( listenerGroup.isEmpty() ) {
		return;
	}
	final PostUpdateEvent event = new PostUpdateEvent(
			getInstance(),
			getId(),
			state,
			previousState,
			dirtyFields,
			getPersister(),
			eventSource()
	);
	for ( PostUpdateEventListener listener : listenerGroup.listeners() ) {
		if ( PostCommitUpdateEventListener.class.isInstance( listener ) ) {
			if ( success ) {
				listener.onPostUpdate( event );
			}
			else {
				((PostCommitUpdateEventListener) listener).onPostUpdateCommitFailed( event );
			}
		}
		else {
			//default to the legacy implementation that always fires the event
			listener.onPostUpdate( event );
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:EntityUpdateAction.java

示例3: configure

import org.hibernate.event.spi.PostCommitUpdateEventListener; //导入依赖的package包/类
@Override
protected void configure() {
    bind(TestEventListener.class)
            .to(PostDeleteEventListener.class)
            .to(PreDeleteEventListener.class)
            .to(PreInsertEventListener.class)
            .to(PostInsertEventListener.class)
            .to(PreUpdateEventListener.class)
            .to(PostUpdateEventListener.class)
            .to(PostCommitInsertEventListener.class)
            .to(PostCommitUpdateEventListener.class)
            .to(PostCommitDeleteEventListener.class)
            .in(PerThread.class);
}
 
开发者ID:krotscheck,项目名称:jersey2-toolkit,代码行数:15,代码来源:HibernateSessionFactoryFactoryTest.java


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