EclipseLink 1.0_1.0M2 API Reference - Incubation

org.eclipse.persistence.mappings.structures
Class ArrayCollectionMappingHelper

java.lang.Object
  extended by org.eclipse.persistence.mappings.structures.ArrayCollectionMappingHelper

public class ArrayCollectionMappingHelper
extends java.lang.Object

Helper class to consolidate all the heinous comparing and merging code for the Array collection mappings.

See Also:
ArrayCollectionMapping

Constructor Summary
ArrayCollectionMappingHelper(ArrayCollectionMapping mapping)
          Constructor.
 
Method Summary
protected  boolean compareElements(java.lang.Object element1, java.lang.Object element2, AbstractSession session)
          Convenience method.
protected  boolean compareElementsForChange(java.lang.Object element1, java.lang.Object element2, AbstractSession session)
          Convenience method.
 ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backup, ObjectChangeSet owner, AbstractSession session)
          INTERNAL: Build and return the change record that results from comparing the two collection attributes.
 boolean compareObjects(java.lang.Object object1, java.lang.Object object2, AbstractSession session)
          INTERNAL: Compare the attributes belonging to this mapping for the objects.
 DatabaseMapping getDatabaseMapping()
          INTERNAL: Return the mapping, casted a bit more generally.
 ArrayCollectionMapping getMapping()
          INTERNAL: Return the mapping.
 void mergeChangesIntoObject(java.lang.Object target, ChangeRecord changeRecord, java.lang.Object source, MergeManager mergeManager)
          INTERNAL: Merge changes from the source to the target object.
 void mergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, MergeManager mergeManager)
          INTERNAL: Merge changes from the source to the target object.
 void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)
          ADVANCED: This method is used to add an object to a collection once the changeSet is applied.
 void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)
          ADVANCED: This method is used to remove an object from a collection once the changeSet is applied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayCollectionMappingHelper

public ArrayCollectionMappingHelper(ArrayCollectionMapping mapping)
Constructor.

Method Detail

compareElements

protected boolean compareElements(java.lang.Object element1,
                                  java.lang.Object element2,
                                  AbstractSession session)
Convenience method. Check for null values before delegating to the mapping.


compareElementsForChange

protected boolean compareElementsForChange(java.lang.Object element1,
                                           java.lang.Object element2,
                                           AbstractSession session)
Convenience method. Check for null values before delegating to the mapping.


getMapping

public ArrayCollectionMapping getMapping()
INTERNAL: Return the mapping.


compareForChange

public ChangeRecord compareForChange(java.lang.Object clone,
                                     java.lang.Object backup,
                                     ObjectChangeSet owner,
                                     AbstractSession session)
INTERNAL: Build and return the change record that results from comparing the two collection attributes.


compareObjects

public boolean compareObjects(java.lang.Object object1,
                              java.lang.Object object2,
                              AbstractSession session)
INTERNAL: Compare the attributes belonging to this mapping for the objects.


mergeChangesIntoObject

public void mergeChangesIntoObject(java.lang.Object target,
                                   ChangeRecord changeRecord,
                                   java.lang.Object source,
                                   MergeManager mergeManager)
INTERNAL: Merge changes from the source to the target object.


mergeIntoObject

public void mergeIntoObject(java.lang.Object target,
                            boolean isTargetUnInitialized,
                            java.lang.Object source,
                            MergeManager mergeManager)
INTERNAL: Merge changes from the source to the target object. Simply replace the entire target collection.


simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.Object changeSetToAdd,
                                              ObjectChangeSet changeSet,
                                              AbstractSession session)
ADVANCED: This method is used to add an object to a collection once the changeSet is applied. The referenceKey parameter should only be used for direct Maps.


simpleRemoveFromCollectionChangeRecord

public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
                                                   java.lang.Object changeSetToRemove,
                                                   ObjectChangeSet changeSet,
                                                   AbstractSession session)
ADVANCED: This method is used to remove an object from a collection once the changeSet is applied. The referenceKey parameter should only be used for direct Maps.


getDatabaseMapping

public DatabaseMapping getDatabaseMapping()
INTERNAL: Return the mapping, casted a bit more generally.


EclipseLink 1.0_1.0M2 API Reference - Incubation