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; }
public boolean onPreUpdate(PreUpdateEvent event) { validate( event.getEntity(), event.getPersister().getEntityMode(), event.getPersister(), event.getSession().getFactory(), GroupsPerOperation.Operation.UPDATE ); return false; }
@Override public boolean onPreUpdate(PreUpdateEvent event) { Object entity = event.getEntity(); Serializable id = event.getId(); encrypt(entity, id, event.getState()); return false; }
@Override public boolean onPreUpdate(PreUpdateEvent event) { String updateMessage = buildUpdateMessage(event); if (!updateMessage.isEmpty()) { audit(event, Modification, event.getEntity(), updateMessage); } return false; }
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(); }
@Override public boolean onPreUpdate(PreUpdateEvent event) { if (event.getEntity() instanceof UpdatedTimestampEntity) { ((UpdatedTimestampEntity) event.getEntity()).updateUpdatedTimestamp(); } return true; }
/** * 엔티티를 갱신하기전에 최종 갱신 시간을 갱신합니다. * * @param event 이벤트 정보 * @return event bubbling을 그만 둘 것인가? */ @Override public boolean onPreUpdate(PreUpdateEvent event) { Object entity = event.getEntity(); if (entity instanceof IUpdateTimestampedEntity) { ((IUpdateTimestampedEntity) entity).updateUpdateTimestamp(); } return false; }
public boolean onPreUpdate(PreUpdateEvent event) { performSecurityCheck( event, PermissibleAction.UPDATE ); return false; }
/** * @see org.hibernate.event.spi.PreUpdateEventListener#onPreUpdate(org.hibernate * .event.spi.PreUpdateEvent) */ @Override public boolean onPreUpdate(PreUpdateEvent event) { execute(preUpdate, event.getEntity()); return false; }
@Override public boolean onPreUpdate(final PreUpdateEvent event) { return false; }
@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; }