}
// Check early return to check if it is a new object, i.e. null primary key.
Boolean doesExist = Boolean.FALSE;
if (primaryKey != null) {
doesExist = (Boolean)existQuery.checkEarlyReturn(clone, primaryKey, unitOfWork, null);
}
if (doesExist == Boolean.FALSE) {
checkNewObjectLockVersion(clone, primaryKey, descriptor, unitOfWork);
Object registeredObject = unitOfWork.internalRegisterObject(clone, descriptor, shouldForceCascade);//should use cloneAndRegisterNewObject to avoid the exist check
this.mergedNewObjects.put(registeredObject, registeredObject);