本文整理汇总了Java中org.hibernate.event.PostDeleteEventListener类的典型用法代码示例。如果您正苦于以下问题:Java PostDeleteEventListener类的具体用法?Java PostDeleteEventListener怎么用?Java PostDeleteEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostDeleteEventListener类属于org.hibernate.event包,在下文中一共展示了PostDeleteEventListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: postDelete
import org.hibernate.event.PostDeleteEventListener; //导入依赖的package包/类
private void postDelete() {
PostDeleteEventListener[] postListeners = getSession().getListeners()
.getPostDeleteEventListeners();
if (postListeners.length>0) {
PostDeleteEvent postEvent = new PostDeleteEvent(
getInstance(),
getId(),
state,
getPersister(),
(EventSource) getSession()
);
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostDelete(postEvent);
}
}
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:EntityDeleteAction.java
示例2: postCommitDelete
import org.hibernate.event.PostDeleteEventListener; //导入依赖的package包/类
private void postCommitDelete() {
PostDeleteEventListener[] postListeners = getSession().getListeners()
.getPostCommitDeleteEventListeners();
if (postListeners.length>0) {
PostDeleteEvent postEvent = new PostDeleteEvent(
getInstance(),
getId(),
state,
getPersister(),
(EventSource) getSession()
);
for ( int i = 0; i < postListeners.length; i++ ) {
postListeners[i].onPostDelete(postEvent);
}
}
}
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:EntityDeleteAction.java
示例3: addEventListeners
import org.hibernate.event.PostDeleteEventListener; //导入依赖的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.PostDeleteEventListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论