本文整理汇总了Java中org.hibernate.event.PostInsertEventListener类的典型用法代码示例。如果您正苦于以下问题:Java PostInsertEventListener类的具体用法?Java PostInsertEventListener怎么用?Java PostInsertEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostInsertEventListener类属于org.hibernate.event包,在下文中一共展示了PostInsertEventListener类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: postInsert
import org.hibernate.event.PostInsertEventListener; //导入依赖的package包/类
private void postInsert() {
PostInsertEventListener[] postListeners = getSession().getListeners()
.getPostInsertEventListeners();
if ( postListeners.length > 0 ) {
PostInsertEvent postEvent = new PostInsertEvent(
getInstance(),
getId(),
state,
getPersister(),
(EventSource) getSession()
);
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostInsert(postEvent);
}
}
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:EntityInsertAction.java
示例2: postCommitInsert
import org.hibernate.event.PostInsertEventListener; //导入依赖的package包/类
private void postCommitInsert() {
PostInsertEventListener[] postListeners = getSession().getListeners()
.getPostCommitInsertEventListeners();
if ( postListeners.length > 0 ) {
PostInsertEvent postEvent = new PostInsertEvent(
getInstance(),
getId(),
state,
getPersister(),
(EventSource) getSession()
);
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostInsert(postEvent);
}
}
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:EntityInsertAction.java
示例3: postInsert
import org.hibernate.event.PostInsertEventListener; //导入依赖的package包/类
private void postInsert() {
if ( isDelayed ) {
getSession().getPersistenceContext().replaceDelayedEntityIdentityInsertKeys( delayedEntityKey, generatedId );
}
PostInsertEventListener[] postListeners = getSession().getListeners()
.getPostInsertEventListeners();
if (postListeners.length>0) {
PostInsertEvent postEvent = new PostInsertEvent(
getInstance(),
generatedId,
state,
getPersister(),
(EventSource) getSession()
);
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostInsert(postEvent);
}
}
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:20,代码来源:EntityIdentityInsertAction.java
示例4: postCommitInsert
import org.hibernate.event.PostInsertEventListener; //导入依赖的package包/类
private void postCommitInsert() {
PostInsertEventListener[] postListeners = getSession().getListeners()
.getPostCommitInsertEventListeners();
if (postListeners.length>0) {
PostInsertEvent postEvent = new PostInsertEvent(
getInstance(),
generatedId,
state,
getPersister(),
(EventSource) getSession()
);
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostInsert(postEvent);
}
}
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:EntityIdentityInsertAction.java
示例5: addEventListeners
import org.hibernate.event.PostInsertEventListener; //导入依赖的package包/类
private static void addEventListeners(PageContext pc, SessionFactoryData data, Key key) throws PageException {
if(!data.getORMConfiguration().eventHandling()) return;
String eventHandler = data.getORMConfiguration().eventHandler();
AllEventListener listener=null;
if(!Util.isEmpty(eventHandler,true)){
//try {
Component c = pc.loadComponent(eventHandler.trim());
listener = new AllEventListener(c);
//config.setInterceptor(listener);
//}catch (PageException e) {e.printStackTrace();}
}
Configuration conf = data.getConfiguration(key);
conf.setInterceptor(new InterceptorImpl(listener));
EventListeners listeners = conf.getEventListeners();
Map<String, CFCInfo> cfcs = data.getCFCs(key);
// post delete
List<EventListener>
list=merge(listener,cfcs,CommonUtil.POST_DELETE);
listeners.setPostDeleteEventListeners(list.toArray(new PostDeleteEventListener[list.size()]));
// post insert
list=merge(listener,cfcs,CommonUtil.POST_INSERT);
listeners.setPostInsertEventListeners(list.toArray(new PostInsertEventListener[list.size()]));
// post update
list=merge(listener,cfcs,CommonUtil.POST_UPDATE);
listeners.setPostUpdateEventListeners(list.toArray(new PostUpdateEventListener[list.size()]));
// post load
list=merge(listener,cfcs,CommonUtil.POST_LOAD);
listeners.setPostLoadEventListeners(list.toArray(new PostLoadEventListener[list.size()]));
// pre delete
list=merge(listener,cfcs,CommonUtil.PRE_DELETE);
listeners.setPreDeleteEventListeners(list.toArray(new PreDeleteEventListener[list.size()]));
// pre insert
//list=merge(listener,cfcs,CommonUtil.PRE_INSERT);
//listeners.setPreInsertEventListeners(list.toArray(new PreInsertEventListener[list.size()]));
// pre load
list=merge(listener,cfcs,CommonUtil.PRE_LOAD);
listeners.setPreLoadEventListeners(list.toArray(new PreLoadEventListener[list.size()]));
// pre update
//list=merge(listener,cfcs,CommonUtil.PRE_UPDATE);
//listeners.setPreUpdateEventListeners(list.toArray(new PreUpdateEventListener[list.size()]));
}
开发者ID:lucee,项目名称:Lucee4,代码行数:50,代码来源:HibernateORMEngine.java
注:本文中的org.hibernate.event.PostInsertEventListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论