1 21 package oracle.toplink.essentials.internal.sessions; 23 24 27 public class AggregateChangeRecord extends ChangeRecord implements oracle.toplink.essentials.changesets.AggregateChangeRecord { 28 protected oracle.toplink.essentials.changesets.ObjectChangeSet changedObject; 29 30 33 public AggregateChangeRecord() { 34 super(); 35 } 36 37 42 public AggregateChangeRecord(ObjectChangeSet owner) { 43 this.owner = owner; 44 } 45 46 51 public oracle.toplink.essentials.changesets.ObjectChangeSet getChangedObject() { 52 return changedObject; 53 } 54 55 59 public void mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) { 60 if (this.changedObject == null) { 61 this.changedObject = ((AggregateChangeRecord)mergeFromRecord).getChangedObject(); 62 if(this.changedObject == null) { 63 return; 64 } else { 65 mergeToChangeSet.addObjectChangeSetForIdentity((ObjectChangeSet)this.changedObject, mergeFromChangeSet.getUOWCloneForObjectChangeSet(this.changedObject)); 66 ((ObjectChangeSet)this.changedObject).updateReferences(mergeToChangeSet, mergeFromChangeSet); 67 return; 68 } 69 } 70 ((ObjectChangeSet)this.changedObject).mergeObjectChanges((ObjectChangeSet)((AggregateChangeRecord)mergeFromRecord).getChangedObject(), mergeToChangeSet, mergeFromChangeSet); 71 } 72 73 78 public void setChangedObject(oracle.toplink.essentials.changesets.ObjectChangeSet newValue) { 79 changedObject = newValue; 80 } 81 82 90 public void updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) { 91 Object localChangeSet = mergeToChangeSet.getUOWCloneForObjectChangeSet(this.changedObject); 92 if (localChangeSet == null) { 93 mergeToChangeSet.addObjectChangeSetForIdentity((ObjectChangeSet)this.changedObject, mergeFromChangeSet.getUOWCloneForObjectChangeSet(this.changedObject)); 94 } 95 } 96 } 97 | Popular Tags |