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

项目:lams    文件:EntityUpdateAction.java   
private boolean preUpdate() {
    boolean veto = false;
    final EventListenerGroup<PreUpdateEventListener> listenerGroup = listenerGroup( EventType.PRE_UPDATE );
    if ( listenerGroup.isEmpty() ) {
        return veto;
    }
    final PreUpdateEvent event = new PreUpdateEvent(
            getInstance(),
            getId(),
            state,
            previousState,
            getPersister(),
            eventSource()
    );
    for ( PreUpdateEventListener listener : listenerGroup.listeners() ) {
        veto |= listener.onPreUpdate( event );
    }
    return veto;
}
项目:lams    文件:BeanValidationEventListener.java   
public boolean onPreUpdate(PreUpdateEvent event) {
    validate(
            event.getEntity(), event.getPersister().getEntityMode(), event.getPersister(),
            event.getSession().getFactory(), GroupsPerOperation.Operation.UPDATE
    );
    return false;
}
项目:ipf-flow-manager    文件:RenderedMessageEncryptEventListener.java   
@Override
public boolean onPreUpdate(PreUpdateEvent event) {
    Object entity = event.getEntity();
    Serializable id = event.getId();
    encrypt(entity, id, event.getState());
    return false;
}
项目:rpb    文件:AuditLogListener.java   
@Override
public boolean onPreUpdate(PreUpdateEvent event) {
    String updateMessage = buildUpdateMessage(event);
    if (!updateMessage.isEmpty()) {
        audit(event, Modification, event.getEntity(), updateMessage);
    }
    return false;
}
项目:rpb    文件:AuditLogListener.java   
private String buildUpdateMessage(PreUpdateEvent event) {
    String[] propertyNames = event.getPersister().getEntityMetamodel().getPropertyNames();
    Object[] oldStates = event.getOldState();
    Object[] newStates = event.getState();
    int index = 0;
    StringBuilder message = new StringBuilder(128);
    for (String propertyName : propertyNames) {
        message.append(message(propertyName, oldStates[index], newStates[index]));
        index++;
    }
    return message.toString();
}
项目:rpb    文件:AuditLogListener.java   
@Override
public boolean onPreUpdate(PreUpdateEvent event) {
    String updateMessage = buildUpdateMessage(event);
    if (!updateMessage.isEmpty()) {
        audit(event, Modification, event.getEntity(), updateMessage);
    }
    return false;
}
项目:rpb    文件:AuditLogListener.java   
private String buildUpdateMessage(PreUpdateEvent event) {
    String[] propertyNames = event.getPersister().getEntityMetamodel().getPropertyNames();
    Object[] oldStates = event.getOldState();
    Object[] newStates = event.getState();
    int index = 0;
    StringBuilder message = new StringBuilder(128);
    for (String propertyName : propertyNames) {
        message.append(message(propertyName, oldStates[index], newStates[index]));
        index++;
    }
    return message.toString();
}
项目:hibernate-examples    文件:UpdatedTimestampEntityListener.java   
@Override
public boolean onPreUpdate(PreUpdateEvent event) {
    if (event.getEntity() instanceof UpdatedTimestampEntity) {
        ((UpdatedTimestampEntity) event.getEntity()).updateUpdatedTimestamp();
    }
    return true;
}
项目:debop4j    文件:UpdateTimestampedEventListener.java   
/**
 * 엔티티를 갱신하기전에 최종 갱신 시간을 갱신합니다.
 *
 * @param event 이벤트 정보
 * @return event bubbling을 그만 둘 것인가?
 */
@Override
public boolean onPreUpdate(PreUpdateEvent event) {
    Object entity = event.getEntity();
    if (entity instanceof IUpdateTimestampedEntity) {
        ((IUpdateTimestampedEntity) entity).updateUpdateTimestamp();
    }
    return false;
}
项目:lams    文件:JaccPreUpdateEventListener.java   
public boolean onPreUpdate(PreUpdateEvent event) {
    performSecurityCheck( event, PermissibleAction.UPDATE );
    return false;
}
项目:spring-entity-listener    文件:HibernateEntityListenersAdapter.java   
/**
 * @see org.hibernate.event.spi.PreUpdateEventListener#onPreUpdate(org.hibernate
 *      .event.spi.PreUpdateEvent)
 */
@Override
public boolean onPreUpdate(PreUpdateEvent event) {
    execute(preUpdate, event.getEntity());
    return false;
}
项目:jersey2-toolkit    文件:HibernateSessionFactoryFactoryTest.java   
@Override
public boolean onPreUpdate(final PreUpdateEvent event) {
    return false;
}
项目:ix3    文件:EventListenerImplRuleEngine.java   
@Override
public boolean onPreUpdate(PreUpdateEvent pue) {
    autowired();
    EntityMode entityMode = pue.getPersister().getEntityMode();



    RuleContext ruleContext = new RuleContextImplNoPrincipal(pue.getEntity(), getOriginalEntity(pue.getOldState(), pue.getPersister()));

    fireRules(ruleContext, pue.getPersister(), pue.getState(), entityMode, RuleGroupPredefined.PreUpdate.class, RuleGroupPredefined.PreInsertOrUpdate.class, RuleGroupPredefined.PreUpdateOrDelete.class, RuleGroupPredefined.PreInsertOrUpdateOrDelete.class);

    return false;
}