/** * INTERNAL: * Extract value from the row and set the attribute to this value in the * working copy clone. * In order to bypass the shared cache when in transaction a UnitOfWork must * be able to populate working copies directly from the row. */ public void buildCloneFromRow(AbstractRecord row, JoinedAttributeManager joinManager, Object clone, CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, UnitOfWorkImpl unitOfWork, AbstractSession executionSession) { // for direct collection a cloned value is no different from an original value Object cloneAttributeValue = valueFromRow(row, joinManager, sourceQuery, sharedCacheKey, executionSession, true, new Boolean[1]); setAttributeValueInObject(clone, cloneAttributeValue); }
public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if(isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
/** * INTERNAL: * Extract value from the row and set the attribute to this value in the * working copy clone. * In order to bypass the shared cache when in transaction a UnitOfWork must * be able to populate working copies directly from the row. */ public void buildCloneFromRow(AbstractRecord row, JoinedAttributeManager joinManager, Object clone, CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, UnitOfWorkImpl unitOfWork, AbstractSession executionSession) { // for direct collection a cloned value is no different from an original value Object cloneAttributeValue = valueFromRow(row, joinManager, sourceQuery, sharedCacheKey, executionSession, true, new Boolean[1]); setAttributeValueInObject(clone, cloneAttributeValue); }
/** * INTERNAL: * Extract value from the row and set the attribute to this value in the * working copy clone. * In order to bypass the shared cache when in transaction a UnitOfWork must * be able to populate working copies directly from the row. */ public void buildCloneFromRow(AbstractRecord row, JoinedAttributeManager joinManager, Object clone, ObjectBuildingQuery sourceQuery, UnitOfWorkImpl unitOfWork, AbstractSession executionSession) { // for direct collection a cloned value is no different from an original value Object cloneAttributeValue = valueFromRow(row, joinManager, sourceQuery, executionSession); setAttributeValueInObject(clone, cloneAttributeValue); }
public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if (isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if(isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if (isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if(isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
public void setAttributeValueInObject(Object object, Object value) throws DescriptorException { if(isWriteOnly()) { return; } super.setAttributeValueInObject(object, value); }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. */ @Override public void buildClone(Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession) { Object attributeValue = this.getAttributeValueFromObject(original); this.setAttributeValueInObject(clone, this.buildClonePart(attributeValue, cacheKey, cloningSession)); }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. */ @Override public void buildClone(Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession) { Object attributeValue = this.getAttributeValueFromObject(original); this.setAttributeValueInObject(clone, this.buildClonePart(attributeValue, cacheKey, cloningSession)); }
/** * INTERNAL: * Clone the attribute from the original and assign it to the clone. */ public void buildClone(Object original, Object clone, UnitOfWorkImpl unitOfWork) { Object attributeValue = this.getAttributeValueFromObject(original); this.setAttributeValueInObject(clone, this.buildClonePart(attributeValue, unitOfWork)); }
/** * INTERNAL: * Copy of the attribute of the object. * This is NOT used for unit of work but for templatizing an object. */ public void buildCopy(Object copy, Object original, ObjectCopyingPolicy policy) { Object attributeValue = getAttributeValueFromObject(original); if (attributeValue == null) { attributeValue = getContainerPolicy().containerInstance(); } else { attributeValue = getContainerPolicy().cloneFor(attributeValue); } setAttributeValueInObject(copy, attributeValue); }
/** * INTERNAL: * Copy of the attribute of the object. * This is NOT used for unit of work but for templatizing an object. */ @Override public void buildCopy(Object copy, Object original, CopyGroup group) { Object attributeValue = getAttributeValueFromObject(original); if (attributeValue == null) { attributeValue = getContainerPolicy().containerInstance(); } else { attributeValue = getContainerPolicy().cloneFor(attributeValue); } setAttributeValueInObject(copy, attributeValue); }
/** * INTERNAL: * Copy of the attribute of the object. * This is NOT used for unit of work but for templatizing an object. */ @Override public void buildCopy(Object copy, Object original, CopyGroup group) { Object attributeValue = getAttributeValueFromObject(original); if (attributeValue == null) { attributeValue = getContainerPolicy().containerInstance(); } else { attributeValue = getContainerPolicy().cloneFor(attributeValue); } setAttributeValueInObject(copy, attributeValue); }
/** * INTERNAL: * Merge changes from the source to the target object. Treat the collection as a * simple direct value, since minimal update isn't possible. */ public void mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager) { if (changeRecord == null) {// I have not calculated changes then simply merge value into target Object targetValue = getRealAttributeValueFromObject(source, mergeManager.getSession()); ContainerPolicy cp = this.getContainerPolicy(); Object container = cp.containerInstance(); Object iter = cp.iteratorFor(targetValue); while (cp.hasNext(iter)) { cp.addInto(cp.next(iter, mergeManager.getSession()), container, mergeManager.getSession()); } setAttributeValueInObject(target, container); } else { setAttributeValueInObject(target, ((DirectToFieldChangeRecord)changeRecord).getNewValue()); } }
/** * INTERNAL: * Merge changes from the source to the target object. This merge is only called when a changeSet for the target * does not exist or the target is uninitialized. * Treat the collection as a simple direct value. */ public void mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager) { Object attributeValue = getAttributeValueFromObject(source); ContainerPolicy cp = this.getContainerPolicy(); Object container = cp.containerInstance(); Object iter = cp.iteratorFor(attributeValue); while (cp.hasNext(iter)) { cp.addInto(cp.next(iter, mergeManager.getSession()), container, mergeManager.getSession()); } setAttributeValueInObject(target, container); }