本文整理汇总了Java中org.hibernate.event.spi.PreInsertEvent类的典型用法代码示例。如果您正苦于以下问题:Java PreInsertEvent类的具体用法?Java PreInsertEvent怎么用?Java PreInsertEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PreInsertEvent类属于org.hibernate.event.spi包,在下文中一共展示了PreInsertEvent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onPreInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
public boolean onPreInsert(PreInsertEvent event) {
validate(
event.getEntity(), event.getPersister().getEntityMode(), event.getPersister(),
event.getSession().getFactory(), GroupsPerOperation.Operation.INSERT
);
return false;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:BeanValidationEventListener.java
示例2: preInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
private boolean preInsert() {
boolean veto = false;
final EventListenerGroup<PreInsertEventListener> listenerGroup = listenerGroup( EventType.PRE_INSERT );
if ( listenerGroup.isEmpty() ) {
return veto;
}
final PreInsertEvent event = new PreInsertEvent( getInstance(), getId(), getState(), getPersister(), eventSource() );
for ( PreInsertEventListener listener : listenerGroup.listeners() ) {
veto |= listener.onPreInsert( event );
}
return veto;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:EntityInsertAction.java
示例3: preInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
private boolean preInsert() {
final EventListenerGroup<PreInsertEventListener> listenerGroup = listenerGroup( EventType.PRE_INSERT );
if ( listenerGroup.isEmpty() ) {
// NO_VETO
return false;
}
boolean veto = false;
final PreInsertEvent event = new PreInsertEvent( getInstance(), null, getState(), getPersister(), eventSource() );
for ( PreInsertEventListener listener : listenerGroup.listeners() ) {
veto |= listener.onPreInsert( event );
}
return veto;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:EntityIdentityInsertAction.java
示例4: onPreInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
@Override
public boolean onPreInsert(PreInsertEvent event) {
Object entity = event.getEntity();
Serializable id = event.getId();
encrypt(entity, id, event.getState());
return false;
}
开发者ID:oehf,项目名称:ipf-flow-manager,代码行数:8,代码来源:RenderedMessageEncryptEventListener.java
示例5: onPreInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
@Override
public boolean onPreInsert(PreInsertEvent event) {
if (event.getEntity() instanceof UpdatedTimestampEntity) {
((UpdatedTimestampEntity) event.getEntity()).updateUpdatedTimestamp();
}
return true;
}
开发者ID:debop,项目名称:hibernate-examples,代码行数:8,代码来源:UpdatedTimestampEntityListener.java
示例6: onPreInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
/**
* 엔티티를 새로 추가하기 전에 최종 갱신 시간을 추가합니다.
*
* @param event 이벤트 정보
* @return event bubbling을 그만 둘 것인가?
*/
@Override
public boolean onPreInsert(PreInsertEvent event) {
Object entity = event.getEntity();
if (entity instanceof IUpdateTimestampedEntity) {
((IUpdateTimestampedEntity) entity).updateUpdateTimestamp();
}
return false;
}
开发者ID:debop,项目名称:debop4j,代码行数:15,代码来源:UpdateTimestampedEventListener.java
示例7: onPreInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
public boolean onPreInsert(PreInsertEvent event) {
performSecurityCheck( event, PermissibleAction.INSERT );
return false;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:JaccPreInsertEventListener.java
示例8: onPreInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
/**
* @see org.hibernate.event.spi.PreInsertEventListener#onPreInsert(org.hibernate
* .event.spi.PreInsertEvent)
*/
@Override
public boolean onPreInsert(PreInsertEvent event) {
execute(preInsert, event.getEntity());
return false;
}
开发者ID:beargiles,项目名称:spring-entity-listener,代码行数:10,代码来源:HibernateEntityListenersAdapter.java
示例9: onPreInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
@Override
public boolean onPreInsert(final PreInsertEvent event) {
return false;
}
开发者ID:krotscheck,项目名称:jersey2-toolkit,代码行数:5,代码来源:HibernateSessionFactoryFactoryTest.java
示例10: onPreInsert
import org.hibernate.event.spi.PreInsertEvent; //导入依赖的package包/类
@Override
public boolean onPreInsert(PreInsertEvent pie) {
autowired();
EntityMode entityMode = pie.getPersister().getEntityMode();
RuleContext ruleContext = new RuleContextImplNoPrincipal(pie.getEntity(), null);
fireRules(ruleContext, pie.getPersister(), pie.getState(), entityMode, RuleGroupPredefined.PreInsert.class, RuleGroupPredefined.PreInsertOrUpdate.class, RuleGroupPredefined.PreInsertOrUpdateOrDelete.class);
return false;
}
开发者ID:ix3,项目名称:ix3,代码行数:13,代码来源:EventListenerImplRuleEngine.java
注:本文中的org.hibernate.event.spi.PreInsertEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论