result = new ValueHolder();
result.setValue(this.getMapping().buildCloneForPartObject(valueHolder.getValue(), original, clone, unitOfWork, false));
} else {
//if I have a relationsip partner trigger the indiretion so that the value will be inserted
// because of this call the entire tree should be recursively cloned
AbstractRecord row = null;
if (valueHolder instanceof DatabaseValueHolder) {
row = ((DatabaseValueHolder)valueHolder).getRow();
}
result = this.getMapping().createUnitOfWorkValueHolder(valueHolder, original, clone, row, unitOfWork, buildDirectlyFromRow);
Object newObject = this.getMapping().buildCloneForPartObject(valueHolder.getValue(), original, clone, unitOfWork, false);
((UnitOfWorkValueHolder)result).privilegedSetValue(newObject);
((UnitOfWorkValueHolder)result).setInstantiated();
}
} else {
AbstractRecord row = null;
if (valueHolder instanceof DatabaseValueHolder) {
row = ((DatabaseValueHolder)valueHolder).getRow();
}
result = this.getMapping().createUnitOfWorkValueHolder(valueHolder, original, clone, row, unitOfWork, buildDirectlyFromRow);
}