/** * Merge changes from the source to the target object. * Simply replace the entire target collection. */ private void mergeChangesIntoObjectWithOrder(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager) { ContainerPolicy cp = this.getContainerPolicy(); AbstractSession session = mergeManager.getSession(); Vector changes = ((EISOrderedCollectionChangeRecord)changeRecord).getNewCollection(); Object targetCollection = cp.containerInstance(changes.size()); for (Enumeration stream = changes.elements(); stream.hasMoreElements();) { Object targetElement = this.buildAddedElementFromChangeSet(stream.nextElement(), mergeManager); cp.addInto(targetElement, targetCollection, session); } // reset the attribute to allow for set method to re-morph changes if the collection is not being stored directly this.setRealAttributeValueInObject(target, targetCollection); }
/** * Merge changes from the source to the target object. * Simply replace the entire target collection. */ private void mergeChangesIntoObjectWithOrder(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) { ContainerPolicy cp = this.getContainerPolicy(); AbstractSession session = mergeManager.getSession(); List changes = ((EISOrderedCollectionChangeRecord)changeRecord).getNewCollection(); Object targetCollection = cp.containerInstance(changes.size()); for (Object changed : changes) { Object targetElement = buildAddedElementFromChangeSet(changed, mergeManager, targetSession); cp.addInto(targetElement, targetCollection, session); } // reset the attribute to allow for set method to re-morph changes if the collection is not being stored directly this.setRealAttributeValueInObject(target, targetCollection); }
/** * Merge changes from the source to the target object. * Simply replace the entire target collection. */ private void mergeChangesIntoObjectWithOrder(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) { ContainerPolicy cp = this.getContainerPolicy(); AbstractSession session = mergeManager.getSession(); List changes = ((EISOrderedCollectionChangeRecord)changeRecord).getNewCollection(); Object targetCollection = cp.containerInstance(changes.size()); for (Object changed : changes) { Object targetElement = buildAddedElementFromChangeSet(changed, mergeManager, targetSession); cp.addInto(targetElement, targetCollection, session); } // reset the attribute to allow for set method to re-morph changes if the collection is not being stored directly this.setRealAttributeValueInObject(target, targetCollection); }
Object addElement = this.buildAddedElementFromChangeSet(stream.nextElement(), mergeManager); cp.addInto(addElement, targetCollection, session); Object changedMapKeyElement = this.buildAddedElementFromChangeSet(stream.nextElement(), mergeManager); Object originalElement = ((UnitOfWorkImpl)session).getOriginalVersionOfObject(changedMapKeyElement); cp.removeFrom(originalElement, targetCollection, session);
Object addElement = buildAddedElementFromChangeSet(added, mergeManager, targetSession); cp.addInto(addElement, targetCollection, session); Object changedMapKeyElement = buildAddedElementFromChangeSet(changed, mergeManager, targetSession); Object originalElement = ((UnitOfWorkImpl)session).getOriginalVersionOfObject(changedMapKeyElement); cp.removeFrom(originalElement, targetCollection, session);
Object addElement = buildAddedElementFromChangeSet(added, mergeManager, targetSession); cp.addInto(addElement, targetCollection, session); Object changedMapKeyElement = buildAddedElementFromChangeSet(changed, mergeManager, targetSession); Object originalElement = ((UnitOfWorkImpl)session).getOriginalVersionOfObject(changedMapKeyElement); cp.removeFrom(originalElement, targetCollection, session);