Top Description Fields Constructors Methods
org.eclipse.persistence.eis.mappings

public Class EISOneToManyMappingHelper

extends Object
Class Inheritance
Imports
java.util.List, org.eclipse.persistence.eis.EISCollectionChangeRecord, .EISOrderedCollectionChangeRecord, org.eclipse.persistence.internal.queries.ContainerPolicy, org.eclipse.persistence.internal.sessions.AbstractSession, .ChangeRecord, .MergeManager, .ObjectChangeSet, .UnitOfWorkImpl, org.eclipse.persistence.mappings.DatabaseMapping

INTERNAL: Helper class to consolidate all the heinous comparing and merging code for the EIS one to many mappings.

Field Summary

Modifier and TypeField and Description
private EISOneToManyMapping
mapping

The mapping that needs help comparing and merging.

private static Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Object
buildAddedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

Convenience method.

private Object
buildChangeSet(Object element, ObjectChangeSet owner, AbstractSession session)

Convenience method.

private Object
buildElementFromElement(Object element, MergeManager mergeManager, AbstractSession targetSession)

Convenience method.

private Object
buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

Convenience method.

private boolean
compareAttributeValues(Object collection1, Object collection2, AbstractSession session)

Compare the attributes.

private ChangeRecord
compareAttributeValuesForChangeWithOrder(Object cloneCollection, Object backupCollection, ObjectChangeSet owner, AbstractSession session)

Build and return the change record that results from comparing the two collection attributes.

private ChangeRecord
compareAttributeValuesForChangeWithoutOrder(Object cloneCollection, Object backupCollection, ObjectChangeSet owner, AbstractSession session)

Build and return the change record that results from comparing the two collection attributes.

private boolean
compareAttributeValuesWithOrder(Object collection1, Object collection2, AbstractSession session)

Compare the attributes.

private boolean
compareAttributeValuesWithoutOrder(Object collection1, Object collection2, AbstractSession session)

Compare the attributes.

private boolean
compareElements(Object element1, Object element2, AbstractSession session)

Convenience method.

private boolean
compareElementsForChange(Object element1, Object element2, AbstractSession session)

Convenience method.

public ChangeRecord
compareForChange(Object clone, Object backup, ObjectChangeSet owner, AbstractSession session)

INTERNAL: Build and return the change record that results from comparing the two collection attributes.

public boolean
compareObjects(Object object1, Object object2, AbstractSession session)

INTERNAL: Compare the attributes belonging to this mapping for the objects.

private String
getAttributeName()

Convenience method.

private ContainerPolicy
getContainerPolicy()

Convenience method.

public DatabaseMapping
getDatabaseMapping()

INTERNAL: Return the mapping, casted a bit more generally.

public EISOneToManyMapping
getMapping()

INTERNAL: Return the mapping.

private Object
private boolean
mapKeyHasChanged(Object element, AbstractSession session)

Convenience method.

public void
mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

INTERNAL: Merge changes from the source to the target object.

private void
mergeChangesIntoObjectWithOrder(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Merge changes from the source to the target object.

private void
mergeChangesIntoObjectWithoutOrder(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Merge changes from the source to the target object.

public void
mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)

INTERNAL: Merge changes from the source to the target object.

private void
setRealAttributeValueInObject(Object object, Object attributeValue)

Convenience method.

public void
simpleAddToCollectionChangeRecord(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)

ADVANCED: This method is used to add an object to a collection once the changeSet is applied.

private void
simpleAddToCollectionChangeRecordWithOrder(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)

Add stuff to an ordered collection.

private void
simpleAddToCollectionChangeRecordWithoutOrder(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)

Add stuff to an unordered collection.

public void
simpleRemoveFromCollectionChangeRecord(Object referenceKey, Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)

ADVANCED: This method is used to remove an object from a collection once the changeSet is applied.

private void
simpleRemoveFromCollectionChangeRecordWithOrder(Object referenceKey, Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)

Remove stuff from an ordered collection.

private void
simpleRemoveFromCollectionChangeRecordWithoutOrder(Object referenceKey, Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)

Remove stuff from an unordered collection.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mappingback to summary
private EISOneToManyMapping mapping

The mapping that needs help comparing and merging.

XXXback to summary
private static Object XXX

Constructor Detail

EISOneToManyMappingHelperback to summary
public EISOneToManyMappingHelper(EISOneToManyMapping mapping)

Constructor.

Method Detail

buildAddedElementFromChangeSetback to summary
private Object buildAddedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

Convenience method.

buildChangeSetback to summary
private Object buildChangeSet(Object element, ObjectChangeSet owner, AbstractSession session)

Convenience method.

buildElementFromElementback to summary
private Object buildElementFromElement(Object element, MergeManager mergeManager, AbstractSession targetSession)

Convenience method.

buildRemovedElementFromChangeSetback to summary
private Object buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

Convenience method.

compareAttributeValuesback to summary
private boolean compareAttributeValues(Object collection1, Object collection2, AbstractSession session)

Compare the attributes. Return true if they are alike. Assume the passed-in attributes are non-null.

compareAttributeValuesForChangeWithOrderback to summary
private ChangeRecord compareAttributeValuesForChangeWithOrder(Object cloneCollection, Object backupCollection, ObjectChangeSet owner, AbstractSession session)

Build and return the change record that results from comparing the two collection attributes. The order of the elements is significant.

compareAttributeValuesForChangeWithoutOrderback to summary
private ChangeRecord compareAttributeValuesForChangeWithoutOrder(Object cloneCollection, Object backupCollection, ObjectChangeSet owner, AbstractSession session)

Build and return the change record that results from comparing the two collection attributes. Ignore the order of the elements.

compareAttributeValuesWithOrderback to summary
private boolean compareAttributeValuesWithOrder(Object collection1, Object collection2, AbstractSession session)

Compare the attributes. Return true if they are alike. The order of the elements is significant.

compareAttributeValuesWithoutOrderback to summary
private boolean compareAttributeValuesWithoutOrder(Object collection1, Object collection2, AbstractSession session)

Compare the attributes. Return true if they are alike. Ignore the order of the elements.

compareElementsback to summary
private boolean compareElements(Object element1, Object element2, AbstractSession session)

Convenience method. Check for null values before delegating to the mapping.

compareElementsForChangeback to summary
private boolean compareElementsForChange(Object element1, Object element2, AbstractSession session)

Convenience method. Check for null values before delegating to the mapping.

compareForChangeback to summary
public ChangeRecord compareForChange(Object clone, Object backup, ObjectChangeSet owner, AbstractSession session)

INTERNAL: Build and return the change record that results from comparing the two collection attributes.

compareObjectsback to summary
public boolean compareObjects(Object object1, Object object2, AbstractSession session)

INTERNAL: Compare the attributes belonging to this mapping for the objects.

getAttributeNameback to summary
private String getAttributeName()

Convenience method.

getContainerPolicyback to summary
private ContainerPolicy getContainerPolicy()

Convenience method.

getDatabaseMappingback to summary
public DatabaseMapping getDatabaseMapping()

INTERNAL: Return the mapping, casted a bit more generally.

getMappingback to summary
public EISOneToManyMapping getMapping()

INTERNAL: Return the mapping.

getRealCollectionAttributeValueFromObjectback to summary
private Object getRealCollectionAttributeValueFromObject(Object object, AbstractSession session)

Convenience method.

mapKeyHasChangedback to summary
private boolean mapKeyHasChanged(Object element, AbstractSession session)

Convenience method.

mergeChangesIntoObjectback to summary
public void mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

INTERNAL: Merge changes from the source to the target object.

mergeChangesIntoObjectWithOrderback to summary
private void mergeChangesIntoObjectWithOrder(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Merge changes from the source to the target object. Simply replace the entire target collection.

mergeChangesIntoObjectWithoutOrderback to summary
private void mergeChangesIntoObjectWithoutOrder(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Merge changes from the source to the target object. Make the necessary removals and adds and map key modifications.

mergeIntoObjectback to summary
public void mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)

INTERNAL: Merge changes from the source to the target object. Simply replace the entire target collection.

setRealAttributeValueInObjectback to summary
private void setRealAttributeValueInObject(Object object, Object attributeValue)

Convenience method.

simpleAddToCollectionChangeRecordback to summary
public void simpleAddToCollectionChangeRecord(Object referenceKey, 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.

simpleAddToCollectionChangeRecordWithOrderback to summary
private void simpleAddToCollectionChangeRecordWithOrder(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)

Add stuff to an ordered collection.

simpleAddToCollectionChangeRecordWithoutOrderback to summary
private void simpleAddToCollectionChangeRecordWithoutOrder(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)

Add stuff to an unordered collection.

simpleRemoveFromCollectionChangeRecordback to summary
public void simpleRemoveFromCollectionChangeRecord(Object referenceKey, 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.

simpleRemoveFromCollectionChangeRecordWithOrderback to summary
private void simpleRemoveFromCollectionChangeRecordWithOrder(Object referenceKey, Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)

Remove stuff from an ordered collection.

simpleRemoveFromCollectionChangeRecordWithoutOrderback to summary
private void simpleRemoveFromCollectionChangeRecordWithoutOrder(Object referenceKey, Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)

Remove stuff from an unordered collection.