/** * Clone the original attribute value. */ public Object buildCloneFor(Object originalAttributeValue) { return getMapping().buildCloneForPartObject(originalAttributeValue, null, this.relationshipSourceObject, getUnitOfWork(), true); }
/** * INTERNAL: * Return a clone of the attribute. * @param buildDirectlyFromRow indicates that we are building the clone directly * from a row as opposed to building the original from the row, putting it in * the shared cache, and then cloning the original. */ public Object cloneAttribute(Object attributeValue, Object original, Object clone, UnitOfWorkImpl unitOfWork, boolean buildDirectlyFromRow) { // Since valueFromRow was called with the UnitOfWork, attributeValue // is already a registered result. if (buildDirectlyFromRow) { return attributeValue; } boolean isExisting = unitOfWork.isObjectRegistered(clone) && (!(unitOfWork.isOriginalNewObject(original))); return this.getMapping().buildCloneForPartObject(attributeValue, original, clone, unitOfWork, isExisting); }
result.setValue(this.getMapping().buildCloneForPartObject(valueHolder.getValue(), original, clone, unitOfWork, false)); } else { Object newObject = this.getMapping().buildCloneForPartObject(valueHolder.getValue(), original, clone, unitOfWork, false); ((UnitOfWorkValueHolder)result).privilegedSetValue(newObject); ((UnitOfWorkValueHolder)result).setInstantiated();
container = getMapping().buildCloneForPartObject(attributeValue, original, clone, unitOfWork, false); } else { if (!(attributeValue instanceof IndirectContainer)) { Object cloneCollection = getMapping().buildCloneForPartObject(attributeValue, original, clone, unitOfWork, false); newValueHolder.privilegedSetValue(cloneCollection); newValueHolder.setInstantiated();