1 21 package oracle.toplink.essentials.internal.sessions; 23 24 import java.util.*; 25 26 29 public class AggregateCollectionChangeRecord extends ChangeRecord implements oracle.toplink.essentials.changesets.AggregateCollectionChangeRecord { 30 protected Vector changedValues; 31 32 35 public AggregateCollectionChangeRecord() { 36 super(); 37 } 38 39 43 public AggregateCollectionChangeRecord(ObjectChangeSet owner) { 44 super(); 45 this.owner = owner; 46 } 47 48 53 public Vector getChangedValues() { 54 if (changedValues == null) { 55 changedValues = new Vector(2); 56 } 57 return changedValues; 58 } 59 60 64 public void mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) { 65 this.setChangedValues(((AggregateCollectionChangeRecord)mergeFromRecord).getChangedValues()); 66 67 for (int index = 0; index < this.getChangedValues().size(); ++index) { 70 ((ObjectChangeSet)this.getChangedValues().get(index)).updateReferences(mergeToChangeSet, mergeFromChangeSet); 71 ; 72 } 73 } 74 75 80 public void setChangedValues(Vector newValues) { 81 changedValues = newValues; 82 } 83 84 92 public void updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) { 93 for (int index = 0; index < this.getChangedValues().size(); ++index) { 94 ObjectChangeSet mergedChangeSet = (ObjectChangeSet)this.getChangedValues().get(index); 95 Object localObject = mergeToChangeSet.getUOWCloneForObjectChangeSet(mergedChangeSet); 96 if (localObject == null) { 97 mergeToChangeSet.addObjectChangeSetForIdentity(mergedChangeSet, mergeFromChangeSet.getUOWCloneForObjectChangeSet(mergedChangeSet)); 98 } 99 } 100 } 101 } 102 | Popular Tags |