EclipseLink1.0 - 20080707 API Reference

org.eclipse.persistence.mappings
Class DirectCollectionMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.ForeignReferenceMapping
          extended by org.eclipse.persistence.mappings.CollectionMapping
              extended by org.eclipse.persistence.mappings.DirectCollectionMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ContainerMapping, RelationalMapping
Direct Known Subclasses:
DirectMapMapping

public class DirectCollectionMapping
extends CollectionMapping
implements RelationalMapping

Purpose: This mapping is used to store a collection of simple types (String, Number, Date, etc.) into a single table. The table must store the value and a foreign key to the source object. A converter can be used if the desired object type and the data type do not match.

See Also:
Converter, ObjectTypeConverter, TypeConversionConverter, SerializedObjectConverter, Serialized Form
Author:
Sati
Since:
TOPLink/Java 1.0

Field Summary
protected  ModifyQuery changeSetDeleteQuery
          Used for deletion when ChangeSets are used
protected static java.lang.String Delete
          Used for data modification events.
protected static java.lang.String DeleteAll
           
protected  org.eclipse.persistence.internal.helper.DatabaseField directField
          The direct field name is converted and stored
protected  boolean hasCustomDeleteQuery
           
protected  boolean hasCustomInsertQuery
           
protected  HistoryPolicy historyPolicy
           
protected static java.lang.String Insert
           
protected  DataModifyQuery insertQuery
          Used for insertion for m-m and dc, not used in 1-m.
protected  java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> referenceKeyFields
           
protected  org.eclipse.persistence.internal.helper.DatabaseTable referenceTable
          Stores the reference table
protected  java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields
           
protected  Converter valueConverter
          Allows user defined conversion between the object value and the database value.
protected  java.lang.String valueConverterClassName
           
 
Fields inherited from class org.eclipse.persistence.mappings.CollectionMapping
containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy
 
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isPrivateOwned, joinFetch, NONE, OUTER_JOIN, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, selectionQuery, tempInitSession, usesBatchReading
 
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
DirectCollectionMapping()
          PUBLIC: Default constructor.
 
Method Summary
 void addReferenceKeyField(org.eclipse.persistence.internal.helper.DatabaseField referenceForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField sourcePrimaryKeyField)
          PUBLIC: Add the reference key field.
 void addReferenceKeyFieldName(java.lang.String referenceForeignKeyFieldName, java.lang.String sourcePrimaryKeyFieldName)
          PUBLIC: Add the name of the reference key field.
 void addToCollectionChangeRecord(java.lang.Object newKey, java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
          INTERNAL: Add a new value and its change set to the collection change record.
 void buildCopy(java.lang.Object copy, java.lang.Object original, ObjectCopyingPolicy policy)
          INTERNAL: Copy of the attribute of the object.
protected  java.lang.Object buildElementClone(java.lang.Object element, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)
          INTERNAL: Clone the element, if necessary.
 void calculateDeferredChanges(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Used by AttributeLevelChangeTracking to update a changeRecord with calculated changes as apposed to detected changes.
 void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
          INTERNAL: Cascade discover and persist new objects during commit.
 void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
          INTERNAL: Cascade perform delete through mappings that require the cascade
 void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)
          INTERNAL: Cascade registerNew for Create through mappings that require the cascade
 java.lang.Object clone()
          INTERNAL: The mapping clones itself to create deep copy.
 void compareCollectionsForChange(java.lang.Object oldCollection, java.lang.Object newCollection, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: This method is used to calculate the differences between two collections.
 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: This method compares the changes between two direct collections.
 boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Compare the attributes belonging to this mapping for the objects.
 void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
          INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary.
protected  java.util.Vector extractKeyFromReferenceRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Extract the source primary key value from the reference direct row.
protected  java.util.Vector extractPrimaryKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Extract the primary key value from the source row.
 java.lang.Object extractResultFromBatchQuery(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
          INTERNAL: Extract the value from the batch optimized query.
 void fixRealObjectReferences(java.lang.Object object, java.util.Map objectInformation, java.util.Map processedObjects, ObjectLevelReadQuery query, RemoteSession session)
          INTERNAL: At this point, we realize we don't have indirection; so we need to replace the reference object(s) with the corresponding object(s) from the remote session.
protected  ModifyQuery getDeleteQuery()
           
 org.eclipse.persistence.internal.helper.DatabaseField getDirectField()
          INTERNAL: Return the direct field.
 java.lang.String getDirectFieldName()
          PUBLIC: Returns the name of the field name in the reference table.
 HistoryPolicy getHistoryPolicy()
          PUBLIC:
protected  DataModifyQuery getInsertQuery()
           
 Expression getJoinCriteria(org.eclipse.persistence.internal.expressions.QueryKeyExpression exp)
          INTERNAL: Returns the join criteria stored in the mapping selection query.
 java.lang.Object getObjectCorrespondingTo(java.lang.Object object, RemoteSession session, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query)
          INTERNAL: return the object on the client corresponding to the specified object.
 java.lang.Class getReferenceClass()
          INTERNAL: This cannot be used with direct collection mappings.
 java.lang.String getReferenceClassName()
          INTERNAL: Returns the reference class name.
 ClassDescriptor getReferenceDescriptor()
          INTERNAL: There is none on direct collection.
 java.util.Vector getReferenceKeyFieldNames()
          INTERNAL: Return the reference key field names associated with the mapping.
 java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getReferenceKeyFields()
          INTERNAL: Return the reference key fields.
 org.eclipse.persistence.internal.helper.DatabaseTable getReferenceTable()
          INTERNAL: Return the direct table.
 java.lang.String getReferenceTableName()
          PUBLIC: Returns the name of the reference table
 java.lang.String getReferenceTableQualifiedName()
          PUBLIC: Returns the qualified name of the reference table
 DatabaseMapping getRelationshipPartner()
          INTERNAL: Return the relationshipPartner mapping for this bi-directional mapping.
 java.util.Vector getSelectFields()
          INTERNAL: Returns the set of fields that should be selected to build this mapping's value(s).
 java.util.Vector getSelectTables()
          INTERNAL: Returns the table(s) that should be selected to build this mapping's value(s).
 java.util.Vector getSourceKeyFieldNames()
          PUBLIC: Return the source key field names associated with the mapping.
 java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeyFields()
          INTERNAL: Return the source key fields.
 Converter getValueConverter()
          PUBLIC: Return the converter on the mapping.
protected  boolean hasCustomDeleteQuery()
           
protected  boolean hasCustomInsertQuery()
           
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize and validate the mapping properties.
protected  void initializeDeleteAllQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
          Initialize delete all query.
protected  void initializeDeleteQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
           
protected  void initializeDirectField(org.eclipse.persistence.internal.sessions.AbstractSession session)
          The field name on the reference table is initialized and cached.
protected  void initializeInsertQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
          Initialize insert query.
protected  void initializeReferenceDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)
          There is no reference descriptor
protected  void initializeReferenceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
          The reference keys on the reference table are initalized
protected  void initializeReferenceTable(org.eclipse.persistence.internal.sessions.AbstractSession session)
          Set the table qualifier on the reference table if required
protected  void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
           
protected  void initializeSelectionQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
          The selection query is initialized
protected  void initializeSelectionStatement(org.eclipse.persistence.internal.sessions.AbstractSession session)
           
protected  void initializeSourceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
          The source keys are initalized
protected  void initializeSourceKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: If a user does not specify the source key then the primary keys of the source table are used.
 boolean isCascadedLockingSupported()
          INTERNAL Return true if this mapping supports cascaded version optimistic locking.
 boolean isChangeTrackingSupported(Project project)
          INTERNAL: Return if this mapping supports change tracking.
 boolean isDirectCollectionMapping()
          INTERNAL:
 boolean isJoiningSupported()
          INTERNAL: Return if this mapping support joining.
protected  boolean isKeyForSourceSpecified()
          INTERNAL: Checks if source and target keys are mentioned by the user or not.
 boolean isPrivateOwned()
          INTERNAL: Return true if referenced objects are provately owned else false.
 boolean isRelationalMapping()
          INTERNAL: All relational mappings should implement this method to return true.
 void iterateOnElement(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)
          INTERNAL: Iterate on the specified element.
 void iterateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object realAttributeValue)
          INTERNAL: Iterate on the attribute value.
 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 performDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Perform the commit event.
 void postInsert(WriteObjectQuery query)
          INTERNAL: Insert the private owned object.
 void postUpdate(WriteObjectQuery writeQuery)
          INTERNAL: Update private owned part.
protected  void postUpdateWithChangeSet(WriteObjectQuery writeQuery)
          INTERNAL: Update private owned part.
 void preDelete(DeleteObjectQuery query)
          INTERNAL: Delete private owned part.
 ReadQuery prepareNestedBatchQuery(ReadAllQuery query)
          INTERNAL: Clone and prepare the selection query as a nested batch read query.
 ObjectLevelReadQuery prepareNestedJoins(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery baseQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Clone and prepare the joined direct query.
protected  void prepareTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key.
 void remoteInitialization(DistributedSession session)
          INTERNAL: Once descriptors are serialized to the remote session.
 void removeFromCollectionChangeRecord(java.lang.Object newKey, java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
          INTERNAL: Remove a value and its change set from the collection change record.
 java.util.Map replaceValueHoldersIn(java.lang.Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)
          INTERNAL: replace the value holders in the specified reference object(s)
 void setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
          ADVANCED: Configure the mapping to use a container policy.
 void setCustomDeleteQuery(ModifyQuery query)
          PUBLIC: The default delete query for this mapping can be overridden by specifying the new query.
 void setCustomInsertQuery(DataModifyQuery query)
          PUBLIC: The default insert query for mapping can be overridden by specifying the new query.
protected  void setDeleteQuery(ModifyQuery query)
           
 void setDeleteSQLString(java.lang.String sqlString)
          PUBLIC: Set the receiver's delete SQL string.
 void setDirectField(org.eclipse.persistence.internal.helper.DatabaseField field)
          PUBLIC: Set the direct field in the reference table.
 void setDirectFieldClassification(java.lang.Class fieldType)
          ADVANCED: Set the class type of the field value.
 void setDirectFieldName(java.lang.String fieldName)
          PUBLIC: Set the direct field name in the reference table.
protected  void setHasCustomDeleteQuery(boolean bool)
           
protected  void setHasCustomInsertQuery(boolean bool)
           
 void setHistoryPolicy(HistoryPolicy policy)
          PUBLIC:
protected  void setInsertQuery(DataModifyQuery insertQuery)
           
 void setInsertSQLString(java.lang.String sqlString)
          PUBLIC: Set the receiver's insert SQL string.
 void setReferenceClass(java.lang.Class referenceClass)
          INTERNAL: This cannot be used with direct collection mappings.
 void setReferenceClassName(java.lang.String referenceClassName)
          INTERNAL: Used by MW.
 void setReferenceKeyFieldName(java.lang.String fieldName)
          PUBLIC: Set the name of the reference key field.
 void setReferenceKeyFieldNames(java.util.Vector fieldNames)
          INTERNAL: Set the reference key field names associated with the mapping.
 void setReferenceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> aVector)
          INTERNAL: Set the reference fields.
 void setReferenceTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
          INTERNAL: Set the reference table.
 void setReferenceTableName(java.lang.String tableName)
          PUBLIC: Set the reference table name.
protected  void setSelectionQueryContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
          INTERNAL: Set the container policy on the selection query for this mapping.
 void setSessionName(java.lang.String name)
          PUBLIC: Set the name of the session to execute the mapping's queries under.
 void setSourceKeyFieldNames(java.util.Vector fieldNames)
          INTERNAL: Set the source key field names associated with the mapping.
 void setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
          INTERNAL: Set the source fields.
 void setValueConverter(Converter valueConverter)
          PUBLIC: Set the converter on the mapping.
 void setValueConverterClassName(java.lang.String valueConverterClassName)
          PUBLIC: Set the converter class name on the mapping.
 void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object objectToAdd, 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 objectToRemove, 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.
 void updateChangeRecord(java.lang.Object clone, java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
          INTERNAL: Either create a new change record or update with the new value.
 void useCollectionClass(java.lang.Class concreteClass)
          PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.
 void useMapClass(java.lang.Class concreteClass, java.lang.String methodName)
          PUBLIC: It is illegal to use a Map as the container of a DirectCollectionMapping.
 java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Return the value of the reference attribute or a value holder.
protected  java.lang.Object valueFromRowInternalWithJoin(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
          INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.
 boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Checks if object is deleted from the database or not.
 
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, cascadeMerge, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, getContainerPolicy, getDeleteAllQuery, getOrderByQueryKeyExpressions, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, hasCustomDeleteAllQuery, hasOrderBy, isAttributeValueInstantiatedOrChanged, isCollectionMapping, objectAddedDuringUpdate, objectRemovedDuringUpdate, objectUnchangedDuringUpdate, objectUnchangedDuringUpdate, readPrivateOwnedForObject, setChangeListener, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllQuery, setDeleteAllSQLString, setHasCustomDeleteAllQuery, useCollectionClassName, useListClassName, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization
 
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchedValueFromRow, buildBackupClone, buildClone, buildCloneFromRow, createUnitOfWorkValueHolder, dontDoMerge, dontUseBatchReading, dontUseIndirection, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchReadObjects, getIndirectionPolicy, getJoinFetch, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, instantiateAttribute, isAttributeValueInstantiated, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isOuterJoinFetched, iterate, mergeRemoteValueHolder, postPrepareNestedBatchQuery, preInitialize, prepareHistoricalQuery, prepareNestedJoinQueryClone, privateOwnedRelationship, setBatchReadObjects, setCascadeAll, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setHasCustomSelectionQuery, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setRealAttributeValueInObject, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setSelectionCall, setSelectionCriteria, setSelectionQuery, setSelectionSQLString, setTempSession, setUsesBatchReading, setUsesIndirection, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldObjectModifyCascadeToParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRowInternal
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, cloneFields, collectFields, extractNestedExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getProperties, getProperty, getSetMethodName, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasRootExpressionThatShouldUseOuterJoin, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCloningRequired, isDatabaseMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isManyToManyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, postDelete, postInitialize, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDescriptor, setFields, setGetMethodName, setIsLazy, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Delete

protected static final java.lang.String Delete
Used for data modification events.

See Also:
Constant Field Values

Insert

protected static final java.lang.String Insert
See Also:
Constant Field Values

DeleteAll

protected static final java.lang.String DeleteAll
See Also:
Constant Field Values

valueConverter

protected Converter valueConverter
Allows user defined conversion between the object value and the database value.


valueConverterClassName

protected java.lang.String valueConverterClassName

referenceTable

protected transient org.eclipse.persistence.internal.helper.DatabaseTable referenceTable
Stores the reference table


directField

protected transient org.eclipse.persistence.internal.helper.DatabaseField directField
The direct field name is converted and stored


sourceKeyFields

protected transient java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields

referenceKeyFields

protected transient java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> referenceKeyFields

insertQuery

protected transient DataModifyQuery insertQuery
Used for insertion for m-m and dc, not used in 1-m.


changeSetDeleteQuery

protected transient ModifyQuery changeSetDeleteQuery
Used for deletion when ChangeSets are used


hasCustomDeleteQuery

protected transient boolean hasCustomDeleteQuery

hasCustomInsertQuery

protected transient boolean hasCustomInsertQuery

historyPolicy

protected HistoryPolicy historyPolicy
Constructor Detail

DirectCollectionMapping

public DirectCollectionMapping()
PUBLIC: Default constructor.

Method Detail

isRelationalMapping

public boolean isRelationalMapping()
Description copied from class: DatabaseMapping
INTERNAL: All relational mappings should implement this method to return true.

Overrides:
isRelationalMapping in class DatabaseMapping

getValueConverter

public Converter getValueConverter()
PUBLIC: Return the converter on the mapping. A converter can be used to convert between the direct collection's object value and database value.


setValueConverter

public void setValueConverter(Converter valueConverter)
PUBLIC: Set the converter on the mapping. A converter can be used to convert between the direct collection's object value and database value.


setValueConverterClassName

public void setValueConverterClassName(java.lang.String valueConverterClassName)
PUBLIC: Set the converter class name on the mapping. Initialized in convertClassNamesToClasses. A converter can be used to convert between the direct collection's object value and database value.


addReferenceKeyField

public void addReferenceKeyField(org.eclipse.persistence.internal.helper.DatabaseField referenceForeignKeyField,
                                 org.eclipse.persistence.internal.helper.DatabaseField sourcePrimaryKeyField)
PUBLIC: Add the reference key field. This is used for composite reference keys. This is the foreign key field in the direct table referencing the primary key of the source object. Both the reference field and the source field that it references must be provided.


addReferenceKeyFieldName

public void addReferenceKeyFieldName(java.lang.String referenceForeignKeyFieldName,
                                     java.lang.String sourcePrimaryKeyFieldName)
PUBLIC: Add the name of the reference key field. This is used for composite reference keys. This is the foreign key field in the direct table referencing the primary key of the source object. Both the reference field name and the name of the source field that it references must be provided.


prepareNestedBatchQuery

public ReadQuery prepareNestedBatchQuery(ReadAllQuery query)
INTERNAL: Clone and prepare the selection query as a nested batch read query. This is used for nested batch reading.

Overrides:
prepareNestedBatchQuery in class ForeignReferenceMapping

prepareNestedJoins

public ObjectLevelReadQuery prepareNestedJoins(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
                                               ObjectBuildingQuery baseQuery,
                                               org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Clone and prepare the joined direct query. Since direct-collection does not build objects a nest query is not required.

Overrides:
prepareNestedJoins in class ForeignReferenceMapping

valueFromRowInternalWithJoin

protected java.lang.Object valueFromRowInternalWithJoin(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                        org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
                                                        ObjectBuildingQuery sourceQuery,
                                                        org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
                                                 throws DatabaseException
INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.

Overrides:
valueFromRowInternalWithJoin in class CollectionMapping
Throws:
DatabaseException

buildCopy

public void buildCopy(java.lang.Object copy,
                      java.lang.Object original,
                      ObjectCopyingPolicy policy)
INTERNAL: Copy of the attribute of the object. This is NOT used for unit of work but for templatizing an object.

Overrides:
buildCopy in class CollectionMapping

buildElementClone

protected java.lang.Object buildElementClone(java.lang.Object element,
                                             org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                             boolean isExisting)
INTERNAL: Clone the element, if necessary. DirectCollections hold on to objects that do not have Descriptors (e.g. int, String). These objects do not need to be cloned, unless they use a converter - they are immutable.

Overrides:
buildElementClone in class CollectionMapping

cascadePerformRemoveIfRequired

public void cascadePerformRemoveIfRequired(java.lang.Object object,
                                           org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                                           java.util.Map visitedObjects)
INTERNAL: Cascade perform delete through mappings that require the cascade

Overrides:
cascadePerformRemoveIfRequired in class CollectionMapping

cascadeRegisterNewIfRequired

public void cascadeRegisterNewIfRequired(java.lang.Object object,
                                         org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
                                         java.util.Map visitedObjects)
INTERNAL: Cascade registerNew for Create through mappings that require the cascade

Overrides:
cascadeRegisterNewIfRequired in class CollectionMapping

cascadeDiscoverAndPersistUnregisteredNewObjects

public void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object,
                                                            java.util.Map newObjects,
                                                            java.util.Map unregisteredExistingObjects,
                                                            java.util.Map visitedObjects,
                                                            org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Cascade discover and persist new objects during commit.

Overrides:
cascadeDiscoverAndPersistUnregisteredNewObjects in class CollectionMapping

clone

public java.lang.Object clone()
INTERNAL: The mapping clones itself to create deep copy.

Overrides:
clone in class ForeignReferenceMapping

compareCollectionsForChange

public void compareCollectionsForChange(java.lang.Object oldCollection,
                                        java.lang.Object newCollection,
                                        org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
                                        org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This method is used to calculate the differences between two collections.

Overrides:
compareCollectionsForChange in class CollectionMapping

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: This method compares the changes between two direct collections. Comparisons are made on equality not identity.

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

compareObjects

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

Overrides:
compareObjects in class CollectionMapping

convertClassNamesToClasses

public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary.

Overrides:
convertClassNamesToClasses in class CollectionMapping
Parameters:
classLoader -

extractKeyFromReferenceRow

protected java.util.Vector extractKeyFromReferenceRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                      org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the source primary key value from the reference direct row. Used for batch reading, most following same order and fields as in the mapping.


extractPrimaryKeyFromRow

protected java.util.Vector extractPrimaryKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                    org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the primary key value from the source row. Used for batch reading, most following same order and fields as in the mapping.


extractResultFromBatchQuery

public java.lang.Object extractResultFromBatchQuery(DatabaseQuery query,
                                                    org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
                                                    org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                    org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
INTERNAL: Extract the value from the batch optimized query.

Overrides:
extractResultFromBatchQuery in class ForeignReferenceMapping

fixRealObjectReferences

public void fixRealObjectReferences(java.lang.Object object,
                                    java.util.Map objectInformation,
                                    java.util.Map processedObjects,
                                    ObjectLevelReadQuery query,
                                    RemoteSession session)
INTERNAL: At this point, we realize we don't have indirection; so we need to replace the reference object(s) with the corresponding object(s) from the remote session. The reference objects for a DirectCollectionMapping are primitives, so they do not need to be replaced.

Overrides:
fixRealObjectReferences in class CollectionMapping

getDeleteQuery

protected ModifyQuery getDeleteQuery()

getSelectFields

public java.util.Vector getSelectFields()
INTERNAL: Returns the set of fields that should be selected to build this mapping's value(s). This is used by expressions to determine which fields to include in the select clause for non-object expressions.

Overrides:
getSelectFields in class DatabaseMapping

getSelectTables

public java.util.Vector getSelectTables()
INTERNAL: Returns the table(s) that should be selected to build this mapping's value(s). This is used by expressions to determine which tables to include in the from clause for non-object expressions.

Overrides:
getSelectTables in class DatabaseMapping

getDirectField

public org.eclipse.persistence.internal.helper.DatabaseField getDirectField()
INTERNAL: Return the direct field. This is the field in the direct table to store the values.


getDirectFieldName

public java.lang.String getDirectFieldName()
PUBLIC: Returns the name of the field name in the reference table.


getInsertQuery

protected DataModifyQuery getInsertQuery()

getJoinCriteria

public Expression getJoinCriteria(org.eclipse.persistence.internal.expressions.QueryKeyExpression exp)
INTERNAL: Returns the join criteria stored in the mapping selection query. This criteria is used to read reference objects across the tables from the database.

Overrides:
getJoinCriteria in class ForeignReferenceMapping

getObjectCorrespondingTo

public java.lang.Object getObjectCorrespondingTo(java.lang.Object object,
                                                 RemoteSession session,
                                                 java.util.Map objectDescriptors,
                                                 java.util.Map processedObjects,
                                                 ObjectLevelReadQuery query)
INTERNAL: return the object on the client corresponding to the specified object. DirectCollections do not have to worry about maintaining object identity.

Overrides:
getObjectCorrespondingTo in class CollectionMapping

getHistoryPolicy

public HistoryPolicy getHistoryPolicy()
PUBLIC:


getReferenceClass

public java.lang.Class getReferenceClass()
INTERNAL: This cannot be used with direct collection mappings.

Overrides:
getReferenceClass in class ForeignReferenceMapping

getReferenceClassName

public java.lang.String getReferenceClassName()
Description copied from class: ForeignReferenceMapping
INTERNAL: Returns the reference class name.

Overrides:
getReferenceClassName in class ForeignReferenceMapping

getReferenceDescriptor

public ClassDescriptor getReferenceDescriptor()
INTERNAL: There is none on direct collection.

Overrides:
getReferenceDescriptor in class ForeignReferenceMapping

getReferenceKeyFieldNames

public java.util.Vector getReferenceKeyFieldNames()
INTERNAL: Return the reference key field names associated with the mapping. These are in-order with the sourceKeyFieldNames.


getReferenceKeyFields

public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getReferenceKeyFields()
INTERNAL: Return the reference key fields.


getReferenceTable

public org.eclipse.persistence.internal.helper.DatabaseTable getReferenceTable()
INTERNAL: Return the direct table. This is the table to store the values.


getReferenceTableName

public java.lang.String getReferenceTableName()
PUBLIC: Returns the name of the reference table


getReferenceTableQualifiedName

public java.lang.String getReferenceTableQualifiedName()
PUBLIC: Returns the qualified name of the reference table


getRelationshipPartner

public DatabaseMapping getRelationshipPartner()
INTERNAL: Return the relationshipPartner mapping for this bi-directional mapping. If the relationshipPartner is null then this is a uni-directional mapping. DirectCollectionMapping can not be part of a bi-directional mapping

Overrides:
getRelationshipPartner in class ForeignReferenceMapping

getSourceKeyFieldNames

public java.util.Vector getSourceKeyFieldNames()
PUBLIC: Return the source key field names associated with the mapping. These are in-order with the referenceKeyFieldNames.


getSourceKeyFields

public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeyFields()
INTERNAL: Return the source key fields.


hasCustomDeleteQuery

protected boolean hasCustomDeleteQuery()

hasCustomInsertQuery

protected boolean hasCustomInsertQuery()

initialize

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

Overrides:
initialize in class CollectionMapping
Throws:
DescriptorException

initializeDeleteAllQuery

protected void initializeDeleteAllQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
Initialize delete all query. This query is used to delete the collection of objects from the reference table.


initializeDeleteQuery

protected void initializeDeleteQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)

initializeDirectField

protected void initializeDirectField(org.eclipse.persistence.internal.sessions.AbstractSession session)
                              throws DescriptorException
The field name on the reference table is initialized and cached.

Throws:
DescriptorException

initializeInsertQuery

protected void initializeInsertQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
Initialize insert query. This query is used to insert the collection of objects into the reference table.


initializeReferenceDescriptor

protected void initializeReferenceDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)
There is no reference descriptor

Overrides:
initializeReferenceDescriptor in class ForeignReferenceMapping

initializeReferenceKeys

protected void initializeReferenceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
                                throws DescriptorException
The reference keys on the reference table are initalized

Throws:
DescriptorException

initializeReferenceTable

protected void initializeReferenceTable(org.eclipse.persistence.internal.sessions.AbstractSession session)
                                 throws DescriptorException
Set the table qualifier on the reference table if required

Throws:
DescriptorException

initializeSelectionCriteria

protected void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)

initializeSelectionQuery

protected void initializeSelectionQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
The selection query is initialized

Overrides:
initializeSelectionQuery in class ForeignReferenceMapping

initializeSelectionStatement

protected void initializeSelectionStatement(org.eclipse.persistence.internal.sessions.AbstractSession session)

initializeSourceKeys

protected void initializeSourceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
The source keys are initalized


initializeSourceKeysWithDefaults

protected void initializeSourceKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: If a user does not specify the source key then the primary keys of the source table are used.


isDirectCollectionMapping

public boolean isDirectCollectionMapping()
INTERNAL:

Overrides:
isDirectCollectionMapping in class DatabaseMapping

isJoiningSupported

public boolean isJoiningSupported()
INTERNAL: Return if this mapping support joining.

Overrides:
isJoiningSupported in class ForeignReferenceMapping

isKeyForSourceSpecified

protected boolean isKeyForSourceSpecified()
INTERNAL: Checks if source and target keys are mentioned by the user or not.


isPrivateOwned

public boolean isPrivateOwned()
INTERNAL: Return true if referenced objects are provately owned else false.

Overrides:
isPrivateOwned in class ForeignReferenceMapping

iterateOnRealAttributeValue

public void iterateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
                                        java.lang.Object realAttributeValue)
INTERNAL: Iterate on the attribute value. The value holder has already been processed. PERF: Avoid iteration if not required.

Overrides:
iterateOnRealAttributeValue in class CollectionMapping

iterateOnElement

public void iterateOnElement(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
                             java.lang.Object element)
INTERNAL: Iterate on the specified element.

Overrides:
iterateOnElement in class CollectionMapping

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. Because this is a collection mapping, values are added to or removed from the collection based on the changeset

Overrides:
mergeChangesIntoObject in class CollectionMapping

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.

Overrides:
mergeIntoObject in class CollectionMapping

performDataModificationEvent

public void performDataModificationEvent(java.lang.Object[] event,
                                         org.eclipse.persistence.internal.sessions.AbstractSession session)
                                  throws DatabaseException,
                                         DescriptorException
INTERNAL: Perform the commit event. This is used in the uow to delay data modifications.

Overrides:
performDataModificationEvent in class DatabaseMapping
Throws:
DatabaseException
DescriptorException

postInsert

public void postInsert(WriteObjectQuery query)
                throws DatabaseException
INTERNAL: Insert the private owned object.

Overrides:
postInsert in class DatabaseMapping
Throws:
DatabaseException

postUpdate

public void postUpdate(WriteObjectQuery writeQuery)
                throws DatabaseException
INTERNAL: Update private owned part.

Overrides:
postUpdate in class DatabaseMapping
Throws:
DatabaseException

postUpdateWithChangeSet

protected void postUpdateWithChangeSet(WriteObjectQuery writeQuery)
                                throws DatabaseException
INTERNAL: Update private owned part.

Throws:
DatabaseException

preDelete

public void preDelete(DeleteObjectQuery query)
               throws DatabaseException
INTERNAL: Delete private owned part. Which is a collection of objects from the reference table.

Overrides:
preDelete in class DatabaseMapping
Throws:
DatabaseException

prepareTranslationRow

protected void prepareTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow,
                                     java.lang.Object object,
                                     org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key.

Overrides:
prepareTranslationRow in class CollectionMapping

remoteInitialization

public void remoteInitialization(DistributedSession session)
INTERNAL: Once descriptors are serialized to the remote session. All its mappings and reference descriptors are traversed. Usually mappings are initilaized and serialized reference descriptors are replaced with local descriptors if they already exist on the remote session.

Overrides:
remoteInitialization in class ForeignReferenceMapping

replaceValueHoldersIn

public java.util.Map replaceValueHoldersIn(java.lang.Object object,
                                           org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)
INTERNAL: replace the value holders in the specified reference object(s)

Overrides:
replaceValueHoldersIn in class CollectionMapping

setDeleteQuery

protected void setDeleteQuery(ModifyQuery query)

setDeleteSQLString

public void setDeleteSQLString(java.lang.String sqlString)
PUBLIC: Set the receiver's delete SQL string. This allows the user to override the SQL generated by TopLink, with there own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. This SQL is responsible for doing the deletion required by the mapping, such as deletion from join table for M-M. Example, 'delete from RESPONS where EMP_ID = #EMP_ID and DESCRIP = #DESCRIP'.


setContainerPolicy

public void setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
ADVANCED: Configure the mapping to use a container policy. The policy manages the access to the collection.

Specified by:
setContainerPolicy in interface ContainerMapping
Overrides:
setContainerPolicy in class CollectionMapping

setCustomDeleteQuery

public void setCustomDeleteQuery(ModifyQuery query)
PUBLIC: The default delete query for this mapping can be overridden by specifying the new query. This query is responsible for doing the deletion required by the mapping, such as deletion from join table for M-M. The query should delete a specific row from the DirectCollectionTable bases on the DirectField.


setCustomInsertQuery

public void setCustomInsertQuery(DataModifyQuery query)
PUBLIC: The default insert query for mapping can be overridden by specifying the new query. This query inserts the row into the direct table.


setDirectField

public void setDirectField(org.eclipse.persistence.internal.helper.DatabaseField field)
PUBLIC: Set the direct field in the reference table. This is the field that the primitive data value is stored in.


setDirectFieldClassification

public void setDirectFieldClassification(java.lang.Class fieldType)
ADVANCED: Set the class type of the field value. This can be used if field value differs from the object value, has specific typing requirements such as usage of java.sql.Blob or NChar. This must be called after the field name has been set.


setDirectFieldName

public void setDirectFieldName(java.lang.String fieldName)
PUBLIC: Set the direct field name in the reference table. This is the field that the primitive data value is stored in.


setHasCustomDeleteQuery

protected void setHasCustomDeleteQuery(boolean bool)

setHasCustomInsertQuery

protected void setHasCustomInsertQuery(boolean bool)

setInsertQuery

protected void setInsertQuery(DataModifyQuery insertQuery)

setInsertSQLString

public void setInsertSQLString(java.lang.String sqlString)
PUBLIC: Set the receiver's insert SQL string. This allows the user to override the SQL generated by TopLink, with there own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. This is used to insert an entry into the direct table. Example, 'insert into RESPONS (EMP_ID, RES_DESC) values (#EMP_ID, #RES_DESC)'.


setReferenceClass

public void setReferenceClass(java.lang.Class referenceClass)
INTERNAL: This cannot be used with direct collection mappings.

Overrides:
setReferenceClass in class ForeignReferenceMapping

setReferenceClassName

public void setReferenceClassName(java.lang.String referenceClassName)
Description copied from class: ForeignReferenceMapping
INTERNAL: Used by MW.

Overrides:
setReferenceClassName in class ForeignReferenceMapping

setReferenceKeyFieldName

public void setReferenceKeyFieldName(java.lang.String fieldName)
PUBLIC: Set the name of the reference key field. This is the foreign key field in the direct table referencing the primary key of the source object. This method is used if the reference key consists of only a single field.


setReferenceKeyFieldNames

public void setReferenceKeyFieldNames(java.util.Vector fieldNames)
INTERNAL: Set the reference key field names associated with the mapping. These must be in-order with the sourceKeyFieldNames.


setReferenceKeyFields

public void setReferenceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> aVector)
INTERNAL: Set the reference fields.


setReferenceTable

public void setReferenceTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: Set the reference table.


setReferenceTableName

public void setReferenceTableName(java.lang.String tableName)
PUBLIC: Set the reference table name.


setSelectionQueryContainerPolicy

protected void setSelectionQueryContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL: Set the container policy on the selection query for this mapping.

Overrides:
setSelectionQueryContainerPolicy in class CollectionMapping

setHistoryPolicy

public void setHistoryPolicy(HistoryPolicy policy)
PUBLIC:


setSessionName

public void setSessionName(java.lang.String name)
PUBLIC: Set the name of the session to execute the mapping's queries under. This can be used by the session broker to override the default session to be used for the target class.

Overrides:
setSessionName in class CollectionMapping

setSourceKeyFieldNames

public void setSourceKeyFieldNames(java.util.Vector fieldNames)
INTERNAL: Set the source key field names associated with the mapping. These must be in-order with the referenceKeyFieldNames.


setSourceKeyFields

public void setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
INTERNAL: Set the source fields.


calculateDeferredChanges

public void calculateDeferredChanges(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
                                     org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Used by AttributeLevelChangeTracking to update a changeRecord with calculated changes as apposed to detected changes. If an attribute can not be change tracked it's changes can be detected through this process.

Overrides:
calculateDeferredChanges in class CollectionMapping

simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.Object objectToAdd,
                                              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 CollectionMapping

simpleRemoveFromCollectionChangeRecord

public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
                                                   java.lang.Object objectToRemove,
                                                   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 CollectionMapping

updateChangeRecord

public void updateChangeRecord(java.lang.Object clone,
                               java.lang.Object newValue,
                               java.lang.Object oldValue,
                               org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
                               org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Either create a new change record or update with the new value. This is used by attribute change tracking. Specifically in a collection mapping this will be called when the customer Set a new collection. In this case we will need to mark the change record with the new and the old versions of the collection. And mark the ObjectChangeSet with the attribute name then when the changes are calculated force a compare on the collections to determine changes.

Overrides:
updateChangeRecord in class CollectionMapping

useCollectionClass

public void useCollectionClass(java.lang.Class concreteClass)
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.

jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface.

jdk1.1.x: The container class must be a subclass of Vector.

Specified by:
useCollectionClass in interface ContainerMapping
Overrides:
useCollectionClass in class CollectionMapping

useMapClass

public void useMapClass(java.lang.Class concreteClass,
                        java.lang.String methodName)
PUBLIC: It is illegal to use a Map as the container of a DirectCollectionMapping. Only Collection containers are supported for DirectCollectionMappings.

Specified by:
useMapClass in interface ContainerMapping
Overrides:
useMapClass in class CollectionMapping
See Also:
DirectMapMapping

valueFromRow

public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                     org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
                                     ObjectBuildingQuery sourceQuery,
                                     org.eclipse.persistence.internal.sessions.AbstractSession session)
                              throws DatabaseException
INTERNAL: Return the value of the reference attribute or a value holder. Check whether the mapping's attribute should be optimized through batch and joining. Overridden to support flasback/historical queries.

Overrides:
valueFromRow in class ForeignReferenceMapping
Throws:
DatabaseException

verifyDelete

public boolean verifyDelete(java.lang.Object object,
                            org.eclipse.persistence.internal.sessions.AbstractSession session)
                     throws DatabaseException
INTERNAL: Checks if object is deleted from the database or not.

Overrides:
verifyDelete in class CollectionMapping
Throws:
DatabaseException

addToCollectionChangeRecord

public void addToCollectionChangeRecord(java.lang.Object newKey,
                                        java.lang.Object newValue,
                                        org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
                                        org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Add a new value and its change set to the collection change record. This is used by attribute change tracking.

Overrides:
addToCollectionChangeRecord in class CollectionMapping

isCascadedLockingSupported

public boolean isCascadedLockingSupported()
INTERNAL Return true if this mapping supports cascaded version optimistic locking.

Overrides:
isCascadedLockingSupported in class DatabaseMapping

isChangeTrackingSupported

public boolean isChangeTrackingSupported(Project project)
INTERNAL: Return if this mapping supports change tracking.

Overrides:
isChangeTrackingSupported in class CollectionMapping

removeFromCollectionChangeRecord

public void removeFromCollectionChangeRecord(java.lang.Object newKey,
                                             java.lang.Object newValue,
                                             org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet,
                                             org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Remove a value and its change set from the collection change record. This is used by attribute change tracking.

Overrides:
removeFromCollectionChangeRecord in class CollectionMapping

EclipseLink1.0 - 20080707 API Reference