當前位置: 首頁>>代碼示例>>Java>>正文


Java PostCommitInsertEventListener類代碼示例

本文整理匯總了Java中org.hibernate.event.spi.PostCommitInsertEventListener的典型用法代碼示例。如果您正苦於以下問題:Java PostCommitInsertEventListener類的具體用法?Java PostCommitInsertEventListener怎麽用?Java PostCommitInsertEventListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PostCommitInsertEventListener類屬於org.hibernate.event.spi包,在下文中一共展示了PostCommitInsertEventListener類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PostCommitEventListenerGroupImpl

import org.hibernate.event.spi.PostCommitInsertEventListener; //導入依賴的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: postCommitInsert

import org.hibernate.event.spi.PostCommitInsertEventListener; //導入依賴的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

示例3: postCommitInsert

import org.hibernate.event.spi.PostCommitInsertEventListener; //導入依賴的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

示例4: configure

import org.hibernate.event.spi.PostCommitInsertEventListener; //導入依賴的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.PostCommitInsertEventListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。