if (wasAClone && (!isARefresh)) {
return workingClone;
}
boolean wasAnOriginal = false;
boolean isIsolated = descriptor.shouldIsolateObjectsInUnitOfWork() || (descriptor.shouldIsolateObjectsInUnitOfWorkEarlyTransaction() && unitOfWork.wasTransactionBegunPrematurely());
Object original = null;
// If not refreshing can get the object from the cache.
if ((!isARefresh) && (!isIsolated) && !unitOfWork.shouldReadFromDB()) {
AbstractSession session = unitOfWork.getParentIdentityMapSession(query);
CacheKey originalCacheKey = session.getIdentityMapAccessorInstance().getCacheKeyForObject(primaryKey, descriptor.getJavaClass(), descriptor);