/** * INTERNAL: * Return the registered working copy from the unit of work identity map. * If not registered in the unit of work yet, return null */ public Object getWorkingCopyFromUnitOfWorkIdentityMap(Object object, Vector primaryKey) { //return the descriptor of the passed object ClassDescriptor descriptor = getDescriptor(object); if (descriptor == null) { throw DescriptorException.missingDescriptor(object.getClass().toString()); } //aggregated object cannot be registered directly, but through the parent owning object. if (descriptor.isDescriptorTypeAggregate()) { throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(object.getClass()); } // Check if the working copy is again being registered in which case we return the same working copy Object registeredObject = getCloneMapping().get(object); if (registeredObject != null) { return object; } //check the unit of work cache first to see if already registered. Object objectFromUOWCache = getIdentityMapAccessorInstance().getIdentityMapManager().getFromIdentityMap(primaryKey, object.getClass(), descriptor); if (objectFromUOWCache != null) { // Has already been cloned, return the working clone from the IM rather than the passed object. return objectFromUOWCache; } //not found, return null return null; }
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(object.getClass());
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(object.getClass());
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(implementation.getClass());
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(implementation.getClass());
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(implementation.getClass());
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(objectToRegister.getClass());
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(object.getClass());
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(objectToRegister.getClass());
throw ValidationException.cannotRegisterAggregateObjectInUnitOfWork(objectToRegister.getClass());