mapping.cascadeMerge(sourceElement, this);
// The check for add depends on the type of merge.
if (shouldMergeWorkingCopyIntoOriginal()) {// Source and backup are the same space.
if (!backupSet.containsKey(sourceElement)) {
changeOccured = true;
containerPolicy.addInto(getTargetVersionOfSourceObject(sourceElement), target, getSession());
} else {
containerPolicy.validateElementAndRehashIfRequired(sourceElement, target, getSession(), getTargetVersionOfSourceObject(sourceElement));
}
} else {// Target and backup are same for all types of merge.
Object targetVersionOfSourceElement = getTargetVersionOfSourceObject(sourceElement);