/** * INTERNAL: * Return if the transformation has no attribute, is write only. */ @Override public boolean isWriteOnly() { return (getAttributeName() == null) && ((this.attributeTransformer == null) && (this.attributeTransformerClassName == null)); }
/** * INTERNAL: * Return if the transformation has no attribute, is write only. */ @Override public boolean isWriteOnly() { return (getAttributeName() == null) && ((this.attributeTransformer == null) && (this.attributeTransformerClassName == null)); }
/** * INTERNAL: * Return if the transformation has no attribute, is write only. */ public boolean isWriteOnly() { return (getAttributeName() == null) && ((getAttributeTransformer() == null) && (getAttributeTransformerClassName() == null)); }
/** * INTERNAL: * Directly build a change record without comparison */ public ChangeRecord buildChangeRecord(Object clone, ObjectChangeSet owner, AbstractSession session) { TransformationMappingChangeRecord changeRecord = new TransformationMappingChangeRecord(owner); changeRecord.setRow(this.buildPhantomRowFrom(clone, session)); changeRecord.setAttribute(getAttributeName()); changeRecord.setMapping(this); return changeRecord; }
/** * INTERNAL: * Build a change record. */ public ChangeRecord internalBuildChangeRecord(Object clone, Object oldValue, ObjectChangeSet owner, AbstractSession session) { TransformationMappingChangeRecord changeRecord = new TransformationMappingChangeRecord(owner); changeRecord.setRow(buildPhantomRowFrom(clone, session)); changeRecord.setAttribute(getAttributeName()); changeRecord.setMapping(this); changeRecord.setOldValue(oldValue); return changeRecord; }
/** * INTERNAL: * Build a change record. */ public ChangeRecord internalBuildChangeRecord(Object clone, Object oldValue, ObjectChangeSet owner, AbstractSession session) { TransformationMappingChangeRecord changeRecord = new TransformationMappingChangeRecord(owner); changeRecord.setRow(buildPhantomRowFrom(clone, session)); changeRecord.setAttribute(getAttributeName()); changeRecord.setMapping(this); changeRecord.setOldValue(oldValue); return changeRecord; }
/** * INTERNAL: * Either create a new change record or update the change record with the new value. * This is used by attribute change tracking. */ public void updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) { TransformationMappingChangeRecord changeRecord = (TransformationMappingChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName()); if (!isWriteOnly()) { if (changeRecord == null) { objectChangeSet.addChange(buildChangeRecord(clone, objectChangeSet, uow)); } else { changeRecord.setRow(this.buildPhantomRowFrom(clone, uow)); } } }
/** * INTERNAL: * Either create a new change record or update the change record with the new value. * This is used by attribute change tracking. */ @Override public void updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) { TransformationMappingChangeRecord changeRecord = (TransformationMappingChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName()); Object updatedObject = descriptor.getInstantiationPolicy().buildNewInstance(); this.setAttributeValueInObject(updatedObject, newValue); if (!isWriteOnly()) { if (changeRecord == null) { objectChangeSet.addChange(internalBuildChangeRecord(updatedObject, oldValue, objectChangeSet, uow)); } else { changeRecord.setRow(this.buildPhantomRowFrom(updatedObject, uow)); } } }
/** * INTERNAL: * Either create a new change record or update the change record with the new value. * This is used by attribute change tracking. */ @Override public void updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) { TransformationMappingChangeRecord changeRecord = (TransformationMappingChangeRecord)objectChangeSet.getChangesForAttributeNamed(this.getAttributeName()); Object updatedObject = descriptor.getInstantiationPolicy().buildNewInstance(); this.setAttributeValueInObject(updatedObject, newValue); if (!isWriteOnly()) { if (changeRecord == null) { objectChangeSet.addChange(internalBuildChangeRecord(updatedObject, oldValue, objectChangeSet, uow)); } else { changeRecord.setRow(this.buildPhantomRowFrom(updatedObject, uow)); } } }
if ((mergeManager.shouldMergeCloneIntoWorkingCopy() || mergeManager.shouldMergeCloneWithReferencesIntoWorkingCopy()) && !mergeManager.isForRefresh() && (((targetAttribute == null) && (attribute != null)) || ((targetAttribute != null) && ((attribute == null) || ((!targetAttribute.equals(attribute)) && (!Helper.comparePotentialArrays(targetAttribute, attribute))))))) { this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), targetAttribute, attribute); if ((mergeManager.shouldMergeCloneIntoWorkingCopy() || mergeManager.shouldMergeCloneWithReferencesIntoWorkingCopy()) && (!row.get(field).equals(targetRow.get(field)))) { this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), invokeAttributeTransformer(targetRow, source, mergeManager.getSession()), attributeValue); break;
if ((mergeManager.shouldMergeCloneIntoWorkingCopy() || mergeManager.shouldMergeCloneWithReferencesIntoWorkingCopy()) && (((targetAttribute == null) && (attribute != null)) || ((targetAttribute != null) && (!targetAttribute.equals(attribute))))) { this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), targetAttribute, attribute); if ((mergeManager.shouldMergeCloneIntoWorkingCopy() || mergeManager.shouldMergeCloneWithReferencesIntoWorkingCopy()) && (!row.get(field).equals(targetRow.get(field)))) { this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), invokeAttributeTransformer(targetRow, source, mergeManager.getSession()), attributeValue); break;
if ((mergeManager.shouldMergeCloneIntoWorkingCopy() || mergeManager.shouldMergeCloneWithReferencesIntoWorkingCopy()) && !mergeManager.isForRefresh() && (((targetAttribute == null) && (attribute != null)) || ((targetAttribute != null) && ((attribute == null) || ((!targetAttribute.equals(attribute)) && (!Helper.comparePotentialArrays(targetAttribute, attribute))))))) { this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), targetAttribute, attribute); if ((mergeManager.shouldMergeCloneIntoWorkingCopy() || mergeManager.shouldMergeCloneWithReferencesIntoWorkingCopy()) && (!row.get(field).equals(targetRow.get(field)))) { this.descriptor.getObjectChangePolicy().raiseInternalPropertyChangeEvent(target, getAttributeName(), invokeAttributeTransformer(targetRow, source, mergeManager.getSession()), attributeValue); break;