FileDocCategorySizeDatePackage
OrderedCollectionChangeRecord.javaAPI DocGlassfish v2 API5302Tue May 22 16:54:44 BST 2007oracle.toplink.essentials.internal.sessions

OrderedCollectionChangeRecord

public class OrderedCollectionChangeRecord extends ChangeRecord implements oracle.toplink.essentials.changesets.OrderedCollectionChangeRecord

Purpose: This class holds the record of the changes made to a collection attribute of an object.

Description: Collections must be compared to each other and added and removed objects must be recorded seperately. NOTE: This class and its sub class are currently not used within TopLink and should be removed.

Fields Summary
protected Hashtable
addObjectList
protected Vector
addIndexes
protected int
startIndexOfRemove
Constructors Summary
public OrderedCollectionChangeRecord(ObjectChangeSet owner)
This constructor returns a changeRecord representing the DirectCollection mapping

param
owner prototype.changeset.ObjectChangeSet that ObjectChangeSet that uses this record

        this.owner = owner;
        this.startIndexOfRemove = Integer.MAX_VALUE;
    
Methods Summary
public voidaddAdditionChange(java.util.Hashtable additions, java.util.Vector indexes, UnitOfWorkChangeSet changes, AbstractSession session)
This method takes a hastable of primitive objects and adds them to the add list.

        for (Enumeration enumtr = additions.keys(); enumtr.hasMoreElements();) {
            Object index = enumtr.nextElement();
            Object object = additions.get(index);
            Object changeSet = session.getDescriptor(object.getClass()).getObjectBuilder().createObjectChangeSet(object, changes, session);
            additions.put(index, changeSet);
        }

        this.addObjectList = additions;
        this.addIndexes = indexes;
    
public java.util.VectorgetAddIndexes()
This method returns the collection of indexes in which changes were made to this collection.

        if (this.addIndexes == null) {
            this.addIndexes = new Vector(1);
        }
        return addIndexes;
    
public java.util.HashtablegetAddObjectList()
This method returns the collection of ChangeSets that were added to the collection.

        if (this.addObjectList == null) {
            this.addObjectList = new Hashtable(1);
        }
        return addObjectList;
    
public intgetStartRemoveIndex()
This method returns the index from where objects must be removed from the collection

        return this.startIndexOfRemove;
    
public voidmergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL: This method will be used to merge one record into another

        // NOTE: if this class is ever used then this method will need to be implemented
    
public voidsetStartRemoveIndex(int startRemoveIndex)
This method sets the index from where objects must be removed from the collection

        this.startIndexOfRemove = startRemoveIndex;
    
public voidupdateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL: This method will be used to update the objectsChangeSets references

        //if this class is ever used this method will need to be implemented