Java 类org.hibernate.event.spi.PreInsertEvent 实例源码

项目:lams    文件:BeanValidationEventListener.java   
public boolean onPreInsert(PreInsertEvent event) {
    validate(
            event.getEntity(), event.getPersister().getEntityMode(), event.getPersister(),
            event.getSession().getFactory(), GroupsPerOperation.Operation.INSERT
    );
    return false;
}
项目:lams    文件:EntityInsertAction.java   
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;
}
项目:lams    文件:EntityIdentityInsertAction.java   
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;
}
项目:ipf-flow-manager    文件:RenderedMessageEncryptEventListener.java   
@Override
public boolean onPreInsert(PreInsertEvent event) {
    Object entity = event.getEntity();
    Serializable id = event.getId();
    encrypt(entity, id, event.getState());
    return false;
}
项目:hibernate-examples    文件:UpdatedTimestampEntityListener.java   
@Override
public boolean onPreInsert(PreInsertEvent event) {
    if (event.getEntity() instanceof UpdatedTimestampEntity) {
        ((UpdatedTimestampEntity) event.getEntity()).updateUpdatedTimestamp();
    }
    return true;
}
项目:debop4j    文件:UpdateTimestampedEventListener.java   
/**
 * 엔티티를 새로 추가하기 전에 최종 갱신 시간을 추가합니다.
 *
 * @param event 이벤트 정보
 * @return event bubbling을 그만 둘 것인가?
 */
@Override
public boolean onPreInsert(PreInsertEvent event) {
    Object entity = event.getEntity();
    if (entity instanceof IUpdateTimestampedEntity) {
        ((IUpdateTimestampedEntity) entity).updateUpdateTimestamp();
    }
    return false;
}
项目:lams    文件:JaccPreInsertEventListener.java   
public boolean onPreInsert(PreInsertEvent event) {
    performSecurityCheck( event, PermissibleAction.INSERT );
    return false;
}
项目:spring-entity-listener    文件:HibernateEntityListenersAdapter.java   
/**
 * @see org.hibernate.event.spi.PreInsertEventListener#onPreInsert(org.hibernate
 *      .event.spi.PreInsertEvent)
 */
@Override
public boolean onPreInsert(PreInsertEvent event) {
    execute(preInsert, event.getEntity());
    return false;
}
项目:jersey2-toolkit    文件:HibernateSessionFactoryFactoryTest.java   
@Override
public boolean onPreInsert(final PreInsertEvent event) {
    return false;
}
项目:ix3    文件:EventListenerImplRuleEngine.java   
@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;
}