container = this.mapping.buildCloneForPartObject(attributeValue, original, cacheKey, clone, cloningSession, false);
} else {
if (indirectContainer == null) {
valueHolder = new ValueHolder(attributeValue);
}
AbstractRecord row = null;
if (valueHolder instanceof DatabaseValueHolder) {
row = ((DatabaseValueHolder)valueHolder).getRow();
}
//If a new object is being cloned then we must build a new UOWValueHolder
// this is so that new clones can also have their relationships managed
// here the code instantiates the valueholder in a privledged manner because a
// UOWValueHolder will assume the objects in the collection are existing if the valueholder
// Goes through it's own instantiation process.
DatabaseValueHolder newValueHolder = this.mapping.createCloneValueHolder(valueHolder, original, clone, row, cloningSession, buildDirectlyFromRow);
container = buildIndirectContainer(newValueHolder);
Object cloneCollection = this.mapping.buildCloneForPartObject(attributeValue, original, cacheKey, clone, cloningSession, false);
newValueHolder.privilegedSetValue(cloneCollection);
newValueHolder.setInstantiated();
}
} else {
if (indirectContainer == null) {
valueHolder = new ValueHolder(attributeValue);
}
AbstractRecord row = null;
if (valueHolder instanceof DatabaseValueHolder) {
row = ((DatabaseValueHolder)valueHolder).getRow();
}
DatabaseValueHolder uowValueHolder = this.mapping.createCloneValueHolder(valueHolder, original, clone, row, cloningSession, buildDirectlyFromRow);
if ((indirectContainer == null) || !buildDirectlyFromRow) {