EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference

org.eclipse.persistence.mappings
Class DirectMapMapping

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
                  extended by org.eclipse.persistence.mappings.DirectMapMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ContainerMapping, MapComponentMapping, RelationalMapping

public class DirectMapMapping
extends DirectCollectionMapping

Mapping for a collection of key-value pairs. The key and value must be simple types (String, Number, Date, etc.) and stored in a single table along with a foreign key to the source object. A converter can be used on the key and value if the desired object types do not match the data types.

See Also:
Converter, ObjectTypeConverter, TypeConversionConverter, SerializedObjectConverter, Serialized Form
Since:
TopLink 3.5

Field Summary
protected  org.eclipse.persistence.internal.helper.DatabaseField directKeyField
          The direct key field name is converted and stored
protected  Converter keyConverter
          Allows user defined conversion between the object attribute value and the database value.
protected  java.lang.String keyConverterClassName
           
 
Fields inherited from class org.eclipse.persistence.mappings.DirectCollectionMapping
changeSetDeleteQuery, Delete, DeleteAll, directField, hasCustomDeleteQuery, hasCustomInsertQuery, historyPolicy, Insert, insertQuery, referenceKeyFields, referenceTable, sourceKeyFields, valueConverter, 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, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isPrivateOwned, joinFetch, NONE, OUTER_JOIN, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession, usesBatchReading
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, descriptor, fields, isLazy, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_1
 
Constructor Summary
DirectMapMapping()
          DirectMapCollectionMapping constructor
 
Method Summary
 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.
 java.lang.Object buildCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)
          INTERNAL: Require for cloning, the part must be cloned.
protected  java.lang.Object buildKeyClone(java.lang.Object element, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)
          INTERNAL: Clone the key, 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.
 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.
 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: Overwrite super method.
 org.eclipse.persistence.internal.helper.DatabaseField getDirectKeyField()
          INTERNAL:
 java.lang.Class getKeyClass()
          PUBLIC: This is a helper method to get the object class from the key converter if it is a TypeConversionConverter.
 Converter getKeyConverter()
          PUBLIC: Return the converter on the mapping.
 java.lang.Class getValueClass()
          PUBLIC: This is a helper method to get the object class from the value converter if it is a TypeConversionConverter.
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize and validate the mapping properties.
protected  void initializeContainerPolicy(org.eclipse.persistence.internal.sessions.AbstractSession session)
          Set the key and value fields that are used to build the container from database rows.
protected  void initializeDeleteQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
           
protected  void initializeDirectKeyField(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 initializeSelectionStatement(org.eclipse.persistence.internal.sessions.AbstractSession session)
           
 boolean isDirectMapMapping()
          INTERNAL: Related mapping should implement this method to return true.
 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 postInsert(WriteObjectQuery query)
          INTERNAL: Insert the private owned object.
protected  void postUpdateWithChangeSet(WriteObjectQuery writeQuery)
          INTERNAL: Update private owned part.
 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.
 void setDirectKeyField(org.eclipse.persistence.internal.helper.DatabaseField keyField)
          INTERNAL:
 void setDirectKeyFieldClassification(java.lang.Class fieldType)
          ADVANCED: Set the class type of the field value.
 void setDirectKeyFieldName(java.lang.String fieldName)
          PUBLIC: Set the direct key field name in the reference table.
 void setKeyClass(java.lang.Class keyClass)
          PUBLIC: This is a helper method to set the key converter to a TypeConversionConverter.
 void setKeyConverter(Converter keyConverter)
          PUBLIC: Set the converter on the mapping.
 void setKeyConverterClassName(java.lang.String keyConverterClassName)
          INTERNAL: Set the converter class name on the mapping.
 void setValueClass(java.lang.Class valueClass)
          PUBLIC: This is a helper method to set the value converter to a TypeConversionConverter.
 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 the change record with the new value.
 void useMapClass(java.lang.Class concreteClass)
          PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.
 void useTransparentMap()
          PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.
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.
 
Methods inherited from class org.eclipse.persistence.mappings.DirectCollectionMapping
addReferenceKeyField, addReferenceKeyFieldName, buildCopy, buildElementClone, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, clone, compareCollectionsForChange, extractKeyFromReferenceRow, extractPrimaryKeyFromRow, fixRealObjectReferences, getDeleteQuery, getDirectField, getDirectFieldName, getHistoryPolicy, getInsertQuery, getJoinCriteria, getObjectCorrespondingTo, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getReferenceKeyFieldNames, getReferenceKeyFields, getReferenceTable, getReferenceTableName, getReferenceTableQualifiedName, getRelationshipPartner, getSelectFields, getSelectTables, getSourceKeyFieldNames, getSourceKeyFields, getValueConverter, hasCustomDeleteQuery, hasCustomInsertQuery, initializeDeleteAllQuery, initializeDirectField, initializeReferenceDescriptor, initializeReferenceKeys, initializeReferenceTable, initializeSelectionCriteria, initializeSelectionQuery, initializeSourceKeys, initializeSourceKeysWithDefaults, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isDirectCollectionMapping, isJoiningSupported, isKeyForSourceSpecified, isPrivateOwned, isRelationalMapping, iterateOnElement, iterateOnRealAttributeValue, performDataModificationEvent, postUpdate, preDelete, prepareNestedBatchQuery, prepareNestedJoins, prepareTranslationRow, remoteInitialization, replaceValueHoldersIn, setContainerPolicy, setCustomDeleteQuery, setCustomInsertQuery, setDeleteQuery, setDeleteSQLString, setDirectField, setDirectFieldClassification, setDirectFieldName, setHasCustomDeleteQuery, setHasCustomInsertQuery, setHistoryPolicy, setInsertQuery, setInsertSQLString, setReferenceClass, setReferenceClassName, setReferenceKeyFieldName, setReferenceKeyFieldNames, setReferenceKeyFields, setReferenceTable, setReferenceTableName, setSelectionQueryContainerPolicy, setSessionName, setSourceKeyFieldNames, setSourceKeyFields, setValueConverter, setValueConverterClassName, updateCollectionChangeRecord, useCollectionClass, useMapClass, valueFromRow, verifyDelete
 
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildReferencesPKList, cascadeMerge, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, getContainerPolicy, getDeleteAllQuery, getOrderByQueryKeyExpressions, getRealCollectionAttributeValueFromObject, hasCustomDeleteAllQuery, hasOrderBy, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, mustDeleteReferenceObjectsOneByOne, objectAddedDuringUpdate, objectRemovedDuringUpdate, objectUnchangedDuringUpdate, objectUnchangedDuringUpdate, readPrivateOwnedForObject, setChangeListener, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllQuery, setDeleteAllSQLString, setHasCustomDeleteAllQuery, useCollectionClassName, useListClassName, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList
 
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchedValueFromRow, buildBackupClone, buildClone, buildCloneFromRow, createUnitOfWorkValueHolder, dontDoMerge, dontUseBatchReading, dontUseIndirection, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchReadObjects, getIndirectionPolicy, getJoinFetch, getRealAttributeValueFromAttribute, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, instantiateAttribute, isAttributeValueInstantiated, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isOuterJoinFetched, iterate, mergeRemoteValueHolder, postPrepareNestedBatchQuery, preInitialize, prepareHistoricalQuery, prepareNestedJoinQueryClone, privateOwnedRelationship, requiresTransientWeavedFields, setBatchReadObjects, setCascadeAll, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setRealAttributeValueInObject, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionQuery, setSelectionSQLString, setTempSession, setUsesBatchReading, setUsesIndirection, shouldForceInitializationOfSelectionCriteria, 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, getRealAttributeValueFromObject, getSetMethodName, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasRootExpressionThatShouldUseOuterJoin, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCloningRequired, isDatabaseMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isManyToManyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, postInitialize, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, 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

directKeyField

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


keyConverter

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


keyConverterClassName

protected java.lang.String keyConverterClassName
Constructor Detail

DirectMapMapping

public DirectMapMapping()
DirectMapCollectionMapping constructor

Method Detail

getKeyConverter

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


setKeyConverter

public void setKeyConverter(Converter keyConverter)
PUBLIC: Set the converter on the mapping. A converter can be used to convert between the key's object value and database value.


setKeyConverterClassName

public void setKeyConverterClassName(java.lang.String keyConverterClassName)
INTERNAL: Set the converter class name on the mapping. Initialized in convertClassNamesToClasses. A converter can be used to convert between the key's object value and database value.


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)
                                 throws DescriptorException
INTERNAL: Add a new value and its change set to the collection change record. This is used by attribute change tracking. If a value has changed then issue a remove first with the key then an add.

Overrides:
addToCollectionChangeRecord in class DirectCollectionMapping
Throws:
DescriptorException

buildCloneForPartObject

public java.lang.Object buildCloneForPartObject(java.lang.Object attributeValue,
                                                java.lang.Object original,
                                                java.lang.Object clone,
                                                org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                                boolean isExisting)
INTERNAL: Require for cloning, the part must be cloned. Ignore the objects, use the attribute value.

Overrides:
buildCloneForPartObject in class CollectionMapping

buildKeyClone

protected java.lang.Object buildKeyClone(java.lang.Object element,
                                         org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                         boolean isExisting)
INTERNAL: Clone the key, 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.


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 DirectCollectionMapping

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 DirectCollectionMapping
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 DirectCollectionMapping

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 DirectCollectionMapping

getDirectKeyField

public org.eclipse.persistence.internal.helper.DatabaseField getDirectKeyField()
INTERNAL:


initialize

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

Overrides:
initialize in class DirectCollectionMapping
Throws:
DescriptorException

initializeContainerPolicy

protected void initializeContainerPolicy(org.eclipse.persistence.internal.sessions.AbstractSession session)
Set the key and value fields that are used to build the container from database rows.


initializeDeleteQuery

protected void initializeDeleteQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
Overrides:
initializeDeleteQuery in class DirectCollectionMapping

initializeDirectKeyField

protected void initializeDirectKeyField(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.

Overrides:
initializeInsertQuery in class DirectCollectionMapping

initializeSelectionStatement

protected void initializeSelectionStatement(org.eclipse.persistence.internal.sessions.AbstractSession session)
Overrides:
initializeSelectionStatement in class DirectCollectionMapping

isDirectMapMapping

public boolean isDirectMapMapping()
INTERNAL: Related mapping should implement this method to return true.

Overrides:
isDirectMapMapping in class DatabaseMapping

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 DirectCollectionMapping

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 DirectCollectionMapping

postInsert

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

Overrides:
postInsert in class DirectCollectionMapping
Throws:
DatabaseException

postUpdateWithChangeSet

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

Overrides:
postUpdateWithChangeSet in class DirectCollectionMapping
Throws:
DatabaseException

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)
                                      throws DescriptorException
INTERNAL: Remove a value and its change set from the collection change record. This is used by attribute change tracking.

Overrides:
removeFromCollectionChangeRecord in class DirectCollectionMapping
Throws:
DescriptorException

setDirectKeyField

public void setDirectKeyField(org.eclipse.persistence.internal.helper.DatabaseField keyField)
INTERNAL:


setDirectKeyFieldClassification

public void setDirectKeyFieldClassification(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.


setDirectKeyFieldName

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


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)
                        throws DescriptorException
INTERNAL: Either create a new change record or update the change record with the new value. This is used by attribute change tracking.

Overrides:
updateChangeRecord in class DirectCollectionMapping
Throws:
DescriptorException

useMapClass

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

The default container class is java.util.Hashtable.

The container class must implements (directly or indirectly) the Map interface.

Note: Do not use both useMapClass(Class concreteClass), useTransparentMap(). The last use of one of the two methods will override the previous one.

Overrides:
useMapClass in class CollectionMapping

useTransparentMap

public void useTransparentMap()
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects.

The container class must implement (directly or indirectly) the Map interface.

Note: Do not use both useMapClass(Class concreteClass), useTransparentMap(). The last use of one of the two methods will override the previous one.


setKeyClass

public void setKeyClass(java.lang.Class keyClass)
PUBLIC: This is a helper method to set the key converter to a TypeConversionConverter. This ensures that the key value from the database is converted to the correct Java type. The converter can also be set directly. Note that setting the converter to another converter will overwrite this setting.


getKeyClass

public java.lang.Class getKeyClass()
PUBLIC: This is a helper method to get the object class from the key converter if it is a TypeConversionConverter. This returns null if not using a TypeConversionConverter key converter.


setValueClass

public void setValueClass(java.lang.Class valueClass)
PUBLIC: This is a helper method to set the value converter to a TypeConversionConverter. This ensures that the value from the database is converted to the correct Java type. The converter can also be set directly. Note that setting the converter to another converter will overwrite this setting.


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 DirectCollectionMapping

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 DirectCollectionMapping

getValueClass

public java.lang.Class getValueClass()
PUBLIC: This is a helper method to get the object class from the value converter if it is a TypeConversionConverter. This returns null if not using a TypeConversionConverter value converter.


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: Overwrite super method.

Overrides:
extractResultFromBatchQuery in class DirectCollectionMapping

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 DirectCollectionMapping
Throws:
DatabaseException

EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference