public void setInstanceValue(CmpEntityBeanContext ctx, Object value) { FieldState fieldState = getFieldState(ctx); // update current value if (cmpFieldIAmMappedTo != null && cmpFieldIAmMappedTo.isPrimaryKeyMember()) { // if this field shares the column with the primary key field and new value // changes the primary key then we are in an illegal state. if (value != null) { if (fieldState.isLoaded() && fieldState.isValueChanged(value)) { throw CmpMessages.MESSAGES.foreignKeyChangedPrimaryKey( value, getFieldName(), cmpFieldIAmMappedTo.getFieldName(), fieldState.value); } else { fieldState.setValue(value); } } } else { if (cmrChainLink != null && JDBCEntityBridge.isEjbCreateDone(ctx) && fieldState.isLoaded() && fieldState.isValueChanged(value)) { cmrChainLink.execute(ctx, fieldState, value); } fieldState.setValue(value); } // we are loading the field right now so it isLoaded fieldState.setLoaded(); }
public void execute(CmpEntityBeanContext ctx, FieldState fieldState, Object newValue) { nextLink.doExecute(this, ctx, fieldState, newValue); }
public void setNextLink(ChainLink nextLink) { nextLink.nextLink = this.nextLink; this.nextLink = nextLink; }
private void addCMRChainLink(ChainLink nextCMRChainLink) { if (cmrChainLink == null) { cmrChainLink = new DummyChainLink(); } cmrChainLink.setNextLink(nextCMRChainLink); }