1 21 package oracle.toplink.essentials.internal.sessions; 23 24 import java.util.*; 25 26 36 public class OrderedCollectionChangeRecord extends ChangeRecord implements oracle.toplink.essentials.changesets.OrderedCollectionChangeRecord { 37 protected Hashtable addObjectList; 38 protected Vector addIndexes; 39 protected int startIndexOfRemove; 40 41 45 public OrderedCollectionChangeRecord(ObjectChangeSet owner) { 46 this.owner = owner; 47 this.startIndexOfRemove = Integer.MAX_VALUE; 48 } 49 50 53 public void addAdditionChange(Hashtable additions, Vector indexes, UnitOfWorkChangeSet changes, AbstractSession session) { 54 for (Enumeration enumtr = additions.keys(); enumtr.hasMoreElements();) { 55 Object index = enumtr.nextElement(); 56 Object object = additions.get(index); 57 Object changeSet = session.getDescriptor(object.getClass()).getObjectBuilder().createObjectChangeSet(object, changes, session); 58 additions.put(index, changeSet); 59 } 60 61 this.addObjectList = additions; 62 this.addIndexes = indexes; 63 } 64 65 68 public Vector getAddIndexes() { 69 if (this.addIndexes == null) { 70 this.addIndexes = new Vector(1); 71 } 72 return addIndexes; 73 } 74 75 78 public Hashtable getAddObjectList() { 79 if (this.addObjectList == null) { 80 this.addObjectList = new Hashtable(1); 81 } 82 return addObjectList; 83 } 84 85 88 public int getStartRemoveIndex() { 89 return this.startIndexOfRemove; 90 } 91 92 96 public void mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) { 97 } 99 100 103 public void setStartRemoveIndex(int startRemoveIndex) { 104 this.startIndexOfRemove = startRemoveIndex; 105 } 106 107 111 public void updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) { 112 } 114 } 115 | Popular Tags |