EclipseLink1.0 - 20080707 API Reference

org.eclipse.persistence.mappings.structures
Class ObjectArrayMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.AggregateMapping
          extended by org.eclipse.persistence.mappings.foundation.AbstractCompositeCollectionMapping
              extended by org.eclipse.persistence.mappings.structures.ObjectArrayMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ContainerMapping, ArrayCollectionMapping

public class ObjectArrayMapping
extends AbstractCompositeCollectionMapping
implements ArrayCollectionMapping

Purpose: In an object-relational data model, structures can contain "Arrays" or collections of other data-types. In Oracle 8i, a Varray is typically used to represent a collection of primitive data or aggregate structures. These arrays are stored with their parent structure in the same table.

ArrayMapping is used to map a collection of primitive data

ObjectArrayMapping is used to map a collection of Oracle data-type

NOTE: Only Oracle8i supports Varray type.

See Also:
ArrayMapping, Serialized Form
Author:
King (Yaoping) Wang
Since:
TOPLink/Java 3.0

Field Summary
protected  java.lang.String structureName
          Arrays require a structure name, this is the ADT defined for the VARRAY.
 
Fields inherited from class org.eclipse.persistence.mappings.foundation.AbstractCompositeCollectionMapping
converter, field
 
Fields inherited from class org.eclipse.persistence.mappings.AggregateMapping
referenceClass, referenceClassName, referenceDescriptor
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, descriptor, fields, isLazy, isOptional, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, primaryKeyMapping, properties, weight, WEIGHT_1
 
Constructor Summary
ObjectArrayMapping()
           
 
Method Summary
protected  java.lang.Object buildCompositeObject(ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.AbstractRecord nestedRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager)
           
protected  org.eclipse.persistence.internal.sessions.AbstractRecord buildCompositeRow(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord parentRow)
           
 org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Build and return the change record that results from comparing the two aggregate collection attributes.
 boolean compareObjects(java.lang.Object object1, java.lang.Object object2, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Compare the attributes belonging to this mapping for the objects.
 java.lang.String getStructureName()
          PUBLIC: Return the name of the structure.
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize the mapping.
 void mergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
          INTERNAL: Merge changes from the source to the target object.
 void mergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
          INTERNAL: Merge changes from the source to the target object.
 void setFieldName(java.lang.String fieldName)
           
 void setStructureName(java.lang.String structureName)
          PUBLIC: Set the name of the structure.
 void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)
          ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
 void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToRemove, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)
          ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
 
Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractCompositeCollectionMapping
buildAddedElementFromChangeSet, buildBackupClonePart, buildChangeSet, buildClonePart, buildCopyOfAttributeValue, buildElementFromChangeSet, buildElementFromElement, buildRemovedElementFromChangeSet, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, collectFields, compareElements, compareElementsForChange, convertClassNamesToClasses, convertToChangeRecord, fixAttributeValue, getAttributeValueFromBackupClone, getContainerPolicy, getConverter, getField, getRealCollectionAttributeValueFromObject, hasConverter, isAbstractCompositeCollectionMapping, iterateOnAttributeValue, mapKeyHasChanged, postDeleteAttributeValue, postInsertAttributeValue, postUpdateAttributeValue, preDeleteAttributeValue, preInsertAttributeValue, preUpdateAttributeValue, setContainerPolicy, setConverter, setField, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClassName, valueFromRow, verifyDeleteOfAttributeValue, writeFromObjectIntoRow, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow
 
Methods inherited from class org.eclipse.persistence.mappings.AggregateMapping
buildAggregateDeleteQuery, buildAggregateModifyQuery, buildAggregateWriteQuery, buildBackupClone, buildClone, buildCloneFromRow, buildCopy, buildExpression, buildNewMergeInstanceOf, compareAttributeValues, executeEvent, fixObjectReferences, getObjectBuilder, getObjectBuilderForClass, getQueryManager, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getReferenceDescriptor, getReferenceDescriptor, isAggregateMapping, iterate, mergeAttributeValue, postDelete, postInsert, postUpdate, preDelete, preInsert, preUpdate, remoteInitialization, setReferenceClass, setReferenceClassName, setReferenceDescriptor, updateChangeRecord, verifyDelete
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addToCollectionChangeRecord, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeMerge, clone, cloneFields, createUnitOfWorkValueHolder, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getDescriptor, getFieldClassification, getFields, getGetMethodName, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasRootExpressionThatShouldUseOuterJoin, instantiateAttribute, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateObjectMapping, isCascadedLockingSupported, isChangeTrackingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isForeignReferenceMapping, isJoiningSupported, isLazy, isManyToManyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, iterateOnRealAttributeValue, performDataModificationEvent, postInitialize, preInitialize, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readFromRowIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, removeFromCollectionChangeRecord, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDescriptor, setFields, setGetMethodName, setIsLazy, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, toString, validateAfterInitialization, validateBeforeInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.persistence.mappings.structures.ArrayCollectionMapping
buildAddedElementFromChangeSet, buildChangeSet, buildElementFromElement, buildRemovedElementFromChangeSet, compareElements, compareElementsForChange, getAttributeName, getRealCollectionAttributeValueFromObject, mapKeyHasChanged, setRealAttributeValueInObject
 
Methods inherited from interface org.eclipse.persistence.mappings.ContainerMapping
getContainerPolicy, setContainerPolicy, useCollectionClass, useMapClass
 

Field Detail

structureName

protected java.lang.String structureName
Arrays require a structure name, this is the ADT defined for the VARRAY.

Constructor Detail

ObjectArrayMapping

public ObjectArrayMapping()
Method Detail

getStructureName

public java.lang.String getStructureName()
PUBLIC: Return the name of the structure. This is the name of the user defined data type as defined on the database.

Overrides:
getStructureName in class AbstractCompositeCollectionMapping

initialize

public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                throws DescriptorException
INTERNAL: Initialize the mapping.

Overrides:
initialize in class AbstractCompositeCollectionMapping
Throws:
DescriptorException

setFieldName

public void setFieldName(java.lang.String fieldName)

setStructureName

public void setStructureName(java.lang.String structureName)
PUBLIC: Set the name of the structure. This is the name of the user defined data type as defined on the database.


buildCompositeObject

protected java.lang.Object buildCompositeObject(ClassDescriptor descriptor,
                                                org.eclipse.persistence.internal.sessions.AbstractRecord nestedRow,
                                                ObjectBuildingQuery query,
                                                org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager)
Specified by:
buildCompositeObject in class AbstractCompositeCollectionMapping

buildCompositeRow

protected org.eclipse.persistence.internal.sessions.AbstractRecord buildCompositeRow(java.lang.Object attributeValue,
                                                                                     org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                                                     org.eclipse.persistence.internal.sessions.AbstractRecord parentRow)
Specified by:
buildCompositeRow in class AbstractCompositeCollectionMapping

compareForChange

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

Overrides:
compareForChange in class AbstractCompositeCollectionMapping
Returns:
prototype.changeset.ChangeRecord

compareObjects

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

Overrides:
compareObjects in class AbstractCompositeCollectionMapping

mergeChangesIntoObject

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

Overrides:
mergeChangesIntoObject in class AbstractCompositeCollectionMapping

mergeIntoObject

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

Overrides:
mergeIntoObject in class AbstractCompositeCollectionMapping

simpleAddToCollectionChangeRecord

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

Overrides:
simpleAddToCollectionChangeRecord in class AbstractCompositeCollectionMapping

simpleRemoveFromCollectionChangeRecord

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

Overrides:
simpleRemoveFromCollectionChangeRecord in class AbstractCompositeCollectionMapping

EclipseLink1.0 - 20080707 API Reference