FileDocCategorySizeDatePackage
AggregateCollectionChangeRecord.javaAPI DocGlassfish v2 API5040Tue May 22 16:54:42 BST 2007oracle.toplink.essentials.internal.sessions

AggregateCollectionChangeRecord

public class AggregateCollectionChangeRecord extends ChangeRecord implements oracle.toplink.essentials.changesets.AggregateCollectionChangeRecord
This change record records the changes for AggregateCollectionMapping.

Fields Summary
protected Vector
changedValues
Constructors Summary
public AggregateCollectionChangeRecord()
This default constructor referenced internally by SDK XML project

        super();
    
public AggregateCollectionChangeRecord(ObjectChangeSet owner)
This constructor returns an ChangeRecord representing an AggregateMapping.

param
owner oracle.toplink.essentials.internal.sessions.ObjectChangeSet represents the Object Change Set that uses this record

        super();
        this.owner = owner;
    
Methods Summary
public java.util.VectorgetChangedValues()
ADVANCED: Return the values representing the changed AggregateCollection.

return
prototype.changeset.ObjectChanges

        if (changedValues == null) {
            changedValues = new Vector(2);
        }
        return changedValues;
    
public voidmergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL: This method will be used to merge one record into another

        this.setChangedValues(((AggregateCollectionChangeRecord)mergeFromRecord).getChangedValues());

        //an aggregate collection changerecord contains a copy of the entire collection, not just the changes
        //so there in no need to merge it, just replace it.
        for (int index = 0; index < this.getChangedValues().size(); ++index) {
            ((ObjectChangeSet)this.getChangedValues().get(index)).updateReferences(mergeToChangeSet, mergeFromChangeSet);
            ;
        }
    
public voidsetChangedValues(java.util.Vector newValues)
INTERNAL: Set the changed values

param
newValue prototype.changeset.ObjectChanges

        changedValues = newValues;
    
public voidupdateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet)
INTERNAL: This method will be used to update the objectsChangeSets references If this is an aggregate change set then there is no need to update the reference as the ChangeSet has no identity outside of this record Check to see if it exists here already to prevent us from creating a little extra garbage.

        for (int index = 0; index < this.getChangedValues().size(); ++index) {
            ObjectChangeSet mergedChangeSet = (ObjectChangeSet)this.getChangedValues().get(index);
            Object localObject = mergeToChangeSet.getUOWCloneForObjectChangeSet(mergedChangeSet);
            if (localObject == null) {
                mergeToChangeSet.addObjectChangeSetForIdentity(mergedChangeSet, mergeFromChangeSet.getUOWCloneForObjectChangeSet(mergedChangeSet));
            }
        }