/** * Build a clone for the value in a mapping. */ protected Object buildCloneForValue(Object value, Object parent, CacheKey parentCacheKey, CollectionMapping mapping, Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache){ return mapping.buildElementClone(value, parent, parentCacheKey, refreshCascade, cloningSession, isExisting, isFromSharedCache); }
/** * Build a clone for the value in a mapping. */ protected Object buildCloneForValue(Object value, Object parent, CacheKey parentCacheKey, CollectionMapping mapping, Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache){ return mapping.buildElementClone(value, parent, parentCacheKey, refreshCascade, cloningSession, isExisting, isFromSharedCache); }
/** * Build a clone for the value in a mapping. * @param value * @param mapping * @param uow * @param isExisting * @return */ protected Object buildCloneForValue(Object value, Object parent, CollectionMapping mapping, UnitOfWorkImpl uow, boolean isExisting){ return mapping.buildElementClone(value, parent, uow, isExisting); }
/** * INTERNAL: * This method is used to add the next value from an iterator built using ContainerPolicy's iteratorFor() method * into the toCollection. * This method is overridden by subclasses to provide extended functionality for map keys * * @see MappedKeyMapContainerPolicy * * @param valuesIterator * @param toCollection * @param mapping * @param unitOfWork * @param isExisting */ public void addNextValueFromIteratorInto(Object valuesIterator, Object parent, Object toCollection, CollectionMapping mapping, UnitOfWorkImpl unitOfWork, boolean isExisting){ Object cloneValue = mapping.buildElementClone(next(valuesIterator, unitOfWork), parent, unitOfWork, isExisting); // add the object to the uow list of private owned objects if it is a candidate and the // uow should discover new objects if (!isExisting && mapping.isCandidateForPrivateOwnedRemoval() && unitOfWork.shouldDiscoverNewObjects() && cloneValue != null && unitOfWork.isObjectNew(cloneValue)) { unitOfWork.addPrivateOwnedObject(mapping, cloneValue); } addInto(cloneValue, toCollection, unitOfWork); }
/** * INTERNAL: * This method is used to add the next value from an iterator built using ContainerPolicy's iteratorFor() method * into the toCollection. * This method is overridden by subclasses to provide extended functionality for map keys * * @see MappedKeyMapContainerPolicy * * @param valuesIterator * @param toCollection * @param mapping * @param unitOfWork * @param isExisting */ public void addNextValueFromIteratorInto(Object valuesIterator, Object parent, CacheKey parentCacheKey, Object toCollection, CollectionMapping mapping, Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache){ Object cloneValue = mapping.buildElementClone(next(valuesIterator, cloningSession), parent, parentCacheKey, refreshCascade, cloningSession, isExisting, isFromSharedCache); // add the object to the uow list of private owned objects if it is a candidate and the // uow should discover new objects if (cloningSession.isUnitOfWork() && !isExisting && mapping.isCandidateForPrivateOwnedRemoval() && ((UnitOfWorkImpl) cloningSession).shouldDiscoverNewObjects() && cloneValue != null && ((UnitOfWorkImpl) cloningSession).isCloneNewObject(cloneValue)) { ((UnitOfWorkImpl) cloningSession).addPrivateOwnedObject(mapping, cloneValue); } addInto(cloneValue, toCollection, cloningSession); }
/** * INTERNAL: * This method is used to add the next value from an iterator built using ContainerPolicy's iteratorFor() method * into the toCollection. * This method is overridden by subclasses to provide extended functionality for map keys * * @see MappedKeyMapContainerPolicy * * @param valuesIterator * @param toCollection * @param mapping * @param unitOfWork * @param isExisting */ public void addNextValueFromIteratorInto(Object valuesIterator, Object parent, CacheKey parentCacheKey, Object toCollection, CollectionMapping mapping, Integer refreshCascade, AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache){ Object cloneValue = mapping.buildElementClone(next(valuesIterator, cloningSession), parent, parentCacheKey, refreshCascade, cloningSession, isExisting, isFromSharedCache); // add the object to the uow list of private owned objects if it is a candidate and the // uow should discover new objects if (cloningSession.isUnitOfWork() && !isExisting && mapping.isCandidateForPrivateOwnedRemoval() && ((UnitOfWorkImpl) cloningSession).shouldDiscoverNewObjects() && cloneValue != null && ((UnitOfWorkImpl) cloningSession).isCloneNewObject(cloneValue)) { ((UnitOfWorkImpl) cloningSession).addPrivateOwnedObject(mapping, cloneValue); } addInto(cloneValue, toCollection, cloningSession); }