Class AbstractDirectMapping
- java.lang.Object
-
- org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField>
-
- org.eclipse.persistence.mappings.DatabaseMapping
-
- org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
-
- org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,MapComponentMapping,MapKeyMapping
- Direct Known Subclasses:
DirectToFieldMapping,EISDirectMapping,XMLDirectMapping
public abstract class AbstractDirectMapping extends AbstractColumnMapping implements MapKeyMapping
Purpose: Maps an attribute to the corresponding database field type. The list of field types that are supported by EclipseLink's direct to field mapping is dependent on the relational database being used. A converter can be used to convert between the object and data type if they do not match.- See Also:
Converter,ObjectTypeConverter,TypeConversionConverter,SerializedObjectConverter,ClassInstanceConverter, Serialized Form- Author:
- Sati
- Since:
- TopLink/Java 1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ClassattributeClassificationTo specify the conversion typeprotected java.lang.StringattributeClassificationNameprotected java.lang.ClassattributeObjectClassificationPERF: Also store object class of attribute in case of primitive.protected booleanbypassDefaultNullValueCheckPERF: Avoid default null value conversion check if not default null value set in conversion manager.protected java.lang.StringfieldClassificationClassNameprotected java.lang.BooleanisMutablePERF: Indicates if this mapping's attribute is a simple atomic value and cannot be modified, only replaced.protected org.eclipse.persistence.internal.helper.DatabaseTablekeyTableForMapKeyprotected java.lang.ObjectnullValueSupport specification of the value to use for null.-
Fields inherited from class org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
converter, converterClassName, field, isInsertable, isUpdatable
-
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isInSopObject, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, unconvertedProperties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
-
-
Constructor Summary
Constructors Constructor Description AbstractDirectMapping()Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)INTERNAL: Used when initializing queries for mappings that use a Map.voidaddFieldsForMapKey(org.eclipse.persistence.internal.sessions.AbstractRecord joinRow)INTERNAL: Used when initializing queries for mappings that use a Map Called when the insert query is being initialized to ensure the fields for the map key are in the insert query.voidaddKeyToDeletedObjectsList(java.lang.Object object, java.util.Map deletedObjects)INTERNAL: For mappings used as MapKeys in MappedKeyContainerPolicy.voidbuildBackupClone(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Clone the attribute from the clone and assign it to the backup.org.eclipse.persistence.internal.sessions.ChangeRecordbuildChangeRecord(java.lang.Object clone, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Directly build a change record without comparisonvoidbuildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)INTERNAL: Clone the attribute from the original and assign it to the clone.voidbuildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: Extract value from the row and set the attribute to this value in the working copy clone.voidbuildCloneValue(java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Clone the attribute from the original and assign it to the clone.protected java.lang.ObjectbuildCloneValue(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Clone the actual value represented by this mapping.voidbuildCopy(java.lang.Object copy, java.lang.Object original, CopyGroup group)INTERNAL: Copy of the attribute of the object.java.lang.ObjectbuildElementClone(java.lang.Object attributeValue, java.lang.Object parent, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)Build a clone of the given element in a unitOfWork.ExpressionbuildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value for a directToField mapping.ReadQuerybuildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)INTERNAL: Certain key mappings favor different types of selection query.voidbuildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, java.lang.Object original, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: Builds a shallow original object.voidcascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, boolean getAttributeValueFromObject, java.util.Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit to the map key.voidcascadePerformRemoveIfRequired(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.voidcascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)INTERNAL: Cascade perform delete through mappings that require the cascade.voidcascadeRegisterNewIfRequired(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.voidcascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)INTERNAL: Cascade registerNew for Create through mappings that require the cascade.org.eclipse.persistence.internal.sessions.ChangeRecordcompareForChange(java.lang.Object clone, java.lang.Object backUp, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the clone and backup clone values and return a change record if the value changed.booleancompareObjects(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.protected booleancompareObjectValues(java.lang.Object firstValue, java.lang.Object secondValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the attribute values.voidconvertClassNamesToClasses(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.ObjectcreateMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManger, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)INTERNAL Called when a DatabaseMapping is used to map the key in a collection and a join query is executed.java.lang.ObjectcreateMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)INTERNAL Called when a DatabaseMapping is used to map the key in a collection.java.util.List<java.lang.Object>createMapComponentsFromSerializableKeyInfo(java.lang.Object[] keyInfo, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Create an instance of the Key object from the key information extracted from the map.QueryKeycreateQueryKeyForMapKey()INTERNAL: Create a query key that links to the map key.java.lang.ObjectcreateSerializableMapKeyInfo(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Creates the Array of simple types used to recreate this map.java.lang.ObjectcreateStubbedMapComponentFromSerializableKeyInfo(java.lang.Object keyInfo, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Create an instance of the Key object from the key information extracted from the map.voiddeleteMapKey(java.lang.Object objectDeleted, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: For mappings used as MapKeys in MappedKeyContainerPolicy, Delete the passed object if necessary.java.util.MapextractIdentityFieldsForQuery(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the fields for the Map key from the object to use in a query.ExpressiongetAdditionalSelectionCriteriaForMapKey()INTERNAL: Return the selection criteria necessary to select the target object when this mapping is a map key.java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable>getAdditionalTablesForJoinQuery()INTERNAL: Return any tables that will be required when this mapping is used as part of a join query.java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>getAllFieldsForMapKey()INTERNAL: Get all the fields for the map key.java.lang.ClassgetAttributeClassification()PUBLIC: Some databases do not properly support all of the base data types.java.lang.StringgetAttributeClassificationName()INTERNAL: Return the class name of the attribute type.java.lang.ClassgetFieldClassification()ADVANCED: Return the class type of the field value.java.lang.ClassgetFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)INTERNAL: Return the classification for the field contained in the mapping.java.lang.StringgetFieldClassificationClassName()INTERNAL: Get fieldClassificationClassName.java.lang.StringgetFieldName()PUBLIC: Name of the field this mapping represents.java.lang.ObjectgetFieldValue(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Convert the attribute value to a field value.java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField>getForeignKeyFieldsForMapKey()INTERNAL: Return a Map of any foreign keys defined within the the MapKey.java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>getIdentityFieldsForMapKey()INTERNAL: Return the fields that make up the identity of the mapped object.java.lang.ClassgetMapKeyTargetType()INTERNAL: Return the class this key mapping maps or the descriptor for itObjectLevelReadQuerygetNestedJoinQuery(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectLevelReadQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Return the query that is used when this mapping is part of a joined relationship This method is used when this mapping is used to map the key in a Map.java.lang.ObjectgetNullValue()PUBLIC: Allow for the value used for null to be specified.java.lang.ObjectgetObjectValue(java.lang.Object fieldValue, Session session)INTERNAL: Allows for subclasses to convert the attribute value.java.lang.ObjectgetObjectValueWithoutClassCheck(java.lang.Object fieldValue, Session session)INTERNAL: Same as getObjectValue method, but without checking fieldValue's class.ClassDescriptorgetReferenceDescriptor()INTERNAL: Get the descriptor for this mapping This method is potentially called when this mapping is used as a map key and will return null since direct mappings do not have reference descriptors.java.lang.ObjectgetTargetVersionOfSourceObject(java.lang.Object object, java.lang.Object parent, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: If required, get the targetVersion of the source object from the merge manager.java.lang.IntegergetWeight()INTERNAL: Return the weight of the mapping, used to sort mappings to ensure that DirectToField Mappings get merged firstvoidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: The mapping is initialized with the given session.org.eclipse.persistence.internal.sessions.ChangeRecordinternalBuildChangeRecord(java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner)INTERNAL: Build a change record.booleanisAbstractDirectMapping()INTERNAL:booleanisChangeTrackingSupported(Project project)INTERNAL: Return if this mapping supports change tracking.booleanisCloningRequired()INTERNAL: Return if this mapping requires its attribute value to be cloned.booleanisDirectToFieldMapping()INTERNAL:booleanisMutable()PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced.voiditerateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)INTERNAL: Called when iterating through descriptors to handle iteration on this mapping when it is used as a MapKey.voidmergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidmergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidpostInitializeMapKey(org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy policy)INTERNAL: Making any mapping changes necessary to use a the mapping as a map key after initializing the mapping.voidpreInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Initialize the attribute classification.voidpreinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table)INTERNAL: Making any mapping changes necessary to use a the mapping as a map key prior to initializing the mapping.voidremoteInitialization(DistributedSession session)INTERNAL: Once descriptors are serialized to the remote session.booleanrequiresDataModificationEventsForMapKey()INTERNAL: Return whether this mapping requires extra queries to update the rows if it is used as a key in a map.voidsetAttributeClassification(java.lang.Class attributeClassification)PUBLIC: Some databases do not properly support all of the base data types.voidsetAttributeClassificationName(java.lang.String attributeClassificationName)INTERNAL: Set the name of the class for MW usage.voidsetFieldClassification(java.lang.Class fieldType)ADVANCED: Set the class type of the field value.voidsetFieldClassificationClassName(java.lang.String className)INTERNAL: Set the name of the class that will be used for setFieldClassification and deploy time Used internally by JPA deployment.voidsetFieldType(int jdbcType)ADVANCED: Set the JDBC type of the field value.voidsetIsMutable(boolean isMutable)PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced.voidsetNullValue(java.lang.Object nullValue)PUBLIC: Allow for the value used for null to be specified.java.lang.StringtoString()INTERNAL:java.lang.ObjectunwrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow the key mapping to unwrap the object.voidupdateChangeRecord(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.voidvalidateBeforeInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow for subclasses to perform validation.java.lang.ObjectvalueFromObject(java.lang.Object object, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Get the value from the object for this mapping.java.lang.ObjectvalueFromResultSet(java.sql.ResultSet resultSet, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor, java.sql.ResultSetMetaData metaData, int columnNumber, org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform)INTERNAL: Returns the value for the mapping directly from the result-set.java.lang.ObjectvalueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected, java.lang.Boolean[] wasCacheUsed)INTERNAL: Return the mapping's attribute value from the row.java.lang.ObjectwrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow the key mapping to wrap the object.voidwriteFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: Get a value from the object and set that in the respective field of the row.voidwriteFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)INTERNAL: Write the attribute value from the object to the row for update.voidwriteFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: Get a value from the object and set that in the respective field of the row.voidwriteInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Write fields needed for insert into the template for with null values.voidwriteUpdateFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Write fields needed for update into the template for with null values.protected abstract voidwriteValueIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.Object value)INTERNAL:-
Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
clone, collectFields, fixObjectReferences, getConverter, getField, hasConverter, isAbstractColumnMapping, isInsertable, isUpdatable, iterate, setConverter, setConverterClassName, setField
-
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildBackupCloneForPartObject, buildCloneForPartObject, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, collectQueryParameters, convertConverterClassNamesToClasses, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, extractNestedNonAggregateExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDerivedIdMapping, getDescriptor, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getValueFromRemoteValueHolder, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasNestedIdentityReference, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isAttributeValueFromObjectInstantiated, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isForeignReferenceMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, iterateOnRealAttributeValue, load, loadAll, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, postInitialize, postInitializeSourceAndTargetExpressions, postInsert, postUpdate, preDelete, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsCacheable, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateCollectionChangeRecord, validateAfterInitialization, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.mappings.foundation.MapComponentMapping
clone
-
-
-
-
Field Detail
-
attributeClassification
protected transient java.lang.Class attributeClassification
To specify the conversion type
-
attributeClassificationName
protected java.lang.String attributeClassificationName
-
attributeObjectClassification
protected transient java.lang.Class attributeObjectClassification
PERF: Also store object class of attribute in case of primitive.
-
nullValue
protected transient java.lang.Object nullValue
Support specification of the value to use for null.
-
keyTableForMapKey
protected org.eclipse.persistence.internal.helper.DatabaseTable keyTableForMapKey
-
fieldClassificationClassName
protected java.lang.String fieldClassificationClassName
-
bypassDefaultNullValueCheck
protected boolean bypassDefaultNullValueCheck
PERF: Avoid default null value conversion check if not default null value set in conversion manager.
-
isMutable
protected java.lang.Boolean isMutable
PERF: Indicates if this mapping's attribute is a simple atomic value and cannot be modified, only replaced. This is a tri-state to allow user to set to true or false, as default is false but some data-types such as Calendar or byte[] or converter types may be desired to be used as mutable.
-
-
Method Detail
-
addAdditionalFieldsToQuery
public void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
INTERNAL: Used when initializing queries for mappings that use a Map. Called when the selection query is being initialized to add the fields for the map key to the query.- Specified by:
addAdditionalFieldsToQueryin interfaceMapKeyMapping
-
addFieldsForMapKey
public void addFieldsForMapKey(org.eclipse.persistence.internal.sessions.AbstractRecord joinRow)
INTERNAL: Used when initializing queries for mappings that use a Map Called when the insert query is being initialized to ensure the fields for the map key are in the insert query.- Specified by:
addFieldsForMapKeyin interfaceMapKeyMapping
-
addKeyToDeletedObjectsList
public void addKeyToDeletedObjectsList(java.lang.Object object, java.util.Map deletedObjects)INTERNAL: For mappings used as MapKeys in MappedKeyContainerPolicy. Add the target of this mapping to the deleted objects list if necessary This method is used for removal of private owned relationships DirectMappings are dealt with in their parent delete, so this is a no-op.- Specified by:
addKeyToDeletedObjectsListin interfaceMapKeyMapping
-
isMutable
public boolean isMutable()
PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced. This is false by default unless a mutable converter is used such as the SerializedObjectConverter. This can be set to false in this case, or if a Calendar or byte[] is desired to be used as a mutable value it can be set to true.
-
setIsMutable
public void setIsMutable(boolean isMutable)
PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced. This is false by default unless a mutable converter is used such as the SerializedObjectConverter. This can be set to false in this case, or if a Calendar or byte[] is desired to be used as a mutable value it can be set to true.
-
buildBackupClone
public void buildBackupClone(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Clone the attribute from the clone and assign it to the backup.- Specified by:
buildBackupClonein classDatabaseMapping
-
buildChangeRecord
public org.eclipse.persistence.internal.sessions.ChangeRecord buildChangeRecord(java.lang.Object clone, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Directly build a change record without comparison- Overrides:
buildChangeRecordin classDatabaseMapping
-
buildClone
public void buildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)INTERNAL: Clone the attribute from the original and assign it to the clone.- Specified by:
buildClonein classDatabaseMapping
-
buildCloneFromRow
public void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: Extract value from the row and set the attribute to this value in the working copy clone. In order to bypass the shared cache when in transaction a UnitOfWork must be able to populate working copies directly from the row.- Specified by:
buildCloneFromRowin classDatabaseMapping
-
buildCloneValue
public void buildCloneValue(java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Clone the attribute from the original and assign it to the clone. If mutability is configured to be true, clone the attribute if it is an instance of byte[], java.util.Calendar or java.util.Date (or their subclasses).
-
buildCloneValue
protected java.lang.Object buildCloneValue(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Clone the actual value represented by this mapping. Do set the cloned value into the object.
-
buildCopy
public void buildCopy(java.lang.Object copy, java.lang.Object original, CopyGroup group)INTERNAL: Copy of the attribute of the object. This is NOT used for unit of work but for templatizing an object.- Overrides:
buildCopyin classDatabaseMapping
-
buildElementClone
public java.lang.Object buildElementClone(java.lang.Object attributeValue, java.lang.Object parent, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)Build a clone of the given element in a unitOfWork.- Specified by:
buildElementClonein interfaceMapKeyMapping- Returns:
-
buildExpression
public Expression buildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value for a directToField mapping.- Overrides:
buildExpressionin classDatabaseMapping
-
buildSelectionQueryForDirectCollectionKeyMapping
public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL: Certain key mappings favor different types of selection query. Return the appropriate type of selectionQuery.- Specified by:
buildSelectionQueryForDirectCollectionKeyMappingin interfaceMapKeyMapping- Returns:
-
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, boolean getAttributeValueFromObject, java.util.Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit to the map key.- Specified by:
cascadeDiscoverAndPersistUnregisteredNewObjectsin interfaceMapKeyMapping
-
cascadePerformRemoveIfRequired
public void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)INTERNAL: Cascade perform delete through mappings that require the cascade.- Specified by:
cascadePerformRemoveIfRequiredin interfaceMapKeyMapping
-
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:
cascadePerformRemoveIfRequiredin classAbstractColumnMapping
-
cascadeRegisterNewIfRequired
public void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)INTERNAL: Cascade registerNew for Create through mappings that require the cascade.- Specified by:
cascadeRegisterNewIfRequiredin interfaceMapKeyMapping
-
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:
cascadeRegisterNewIfRequiredin classAbstractColumnMapping
-
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: Compare the clone and backup clone values and return a change record if the value changed.- Specified by:
compareForChangein classDatabaseMapping- Returns:
- prototype.changeset.ChangeRecord
-
deleteMapKey
public void deleteMapKey(java.lang.Object objectDeleted, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: For mappings used as MapKeys in MappedKeyContainerPolicy, Delete the passed object if necessary. This method is used for removal of private owned relationships DirectMappings are dealt with in their parent delete, so this is a no-op.- Specified by:
deleteMapKeyin interfaceMapKeyMapping
-
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.- Specified by:
compareObjectsin classDatabaseMapping
-
compareObjectValues
protected boolean compareObjectValues(java.lang.Object firstValue, java.lang.Object secondValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the attribute values.
-
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:
convertClassNamesToClassesin classAbstractColumnMapping
-
createSerializableMapKeyInfo
public java.lang.Object createSerializableMapKeyInfo(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Creates the Array of simple types used to recreate this map.- Specified by:
createSerializableMapKeyInfoin interfaceMapKeyMapping
-
createMapComponentsFromSerializableKeyInfo
public java.util.List<java.lang.Object> createMapComponentsFromSerializableKeyInfo(java.lang.Object[] keyInfo, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Create an instance of the Key object from the key information extracted from the map. This may return the value directly in case of a simple key or will be used as the FK to load a related entity.- Specified by:
createMapComponentsFromSerializableKeyInfoin interfaceMapKeyMapping
-
createStubbedMapComponentFromSerializableKeyInfo
public java.lang.Object createStubbedMapComponentFromSerializableKeyInfo(java.lang.Object keyInfo, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Create an instance of the Key object from the key information extracted from the map. This key object may be a shallow stub of the actual object if the key is an Entity type.- Specified by:
createStubbedMapComponentFromSerializableKeyInfoin interfaceMapKeyMapping
-
createMapComponentFromRow
public java.lang.Object createMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)INTERNAL Called when a DatabaseMapping is used to map the key in a collection. Returns the key.- Specified by:
createMapComponentFromRowin interfaceMapComponentMapping
-
createMapComponentFromJoinedRow
public java.lang.Object createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManger, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)INTERNAL Called when a DatabaseMapping is used to map the key in a collection and a join query is executed. Returns the key.- Specified by:
createMapComponentFromJoinedRowin interfaceMapKeyMapping
-
createQueryKeyForMapKey
public QueryKey createQueryKeyForMapKey()
INTERNAL: Create a query key that links to the map key.- Specified by:
createQueryKeyForMapKeyin interfaceMapKeyMapping- Returns:
-
extractIdentityFieldsForQuery
public java.util.Map extractIdentityFieldsForQuery(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the fields for the Map key from the object to use in a query.- Specified by:
extractIdentityFieldsForQueryin interfaceMapKeyMapping- Returns:
-
getAdditionalTablesForJoinQuery
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable> getAdditionalTablesForJoinQuery()
INTERNAL: Return any tables that will be required when this mapping is used as part of a join query.- Specified by:
getAdditionalTablesForJoinQueryin interfaceMapKeyMapping- Returns:
-
getAttributeClassification
public java.lang.Class getAttributeClassification()
PUBLIC: Some databases do not properly support all of the base data types. For these databases, the base data type must be explicitly specified in the mapping to tell EclipseLink to force the instance variable value to that data type.- Overrides:
getAttributeClassificationin classDatabaseMapping
-
getAttributeClassificationName
public java.lang.String getAttributeClassificationName()
INTERNAL: Return the class name of the attribute type. This is only used by the MW.
-
getObjectValue
public java.lang.Object getObjectValue(java.lang.Object fieldValue, Session session)INTERNAL: Allows for subclasses to convert the attribute value.- Specified by:
getObjectValuein classAbstractColumnMapping
-
getObjectValueWithoutClassCheck
public java.lang.Object getObjectValueWithoutClassCheck(java.lang.Object fieldValue, Session session)INTERNAL: Same as getObjectValue method, but without checking fieldValue's class. Used in case the fieldValue class is already known to be the same as attributeClassification.
-
isAbstractDirectMapping
public boolean isAbstractDirectMapping()
INTERNAL:- Overrides:
isAbstractDirectMappingin classDatabaseMapping
-
getReferenceDescriptor
public ClassDescriptor getReferenceDescriptor()
INTERNAL: Get the descriptor for this mapping This method is potentially called when this mapping is used as a map key and will return null since direct mappings do not have reference descriptors.- Specified by:
getReferenceDescriptorin interfaceMapKeyMapping- Overrides:
getReferenceDescriptorin classDatabaseMapping- Returns:
-
getFieldClassification
public java.lang.Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
INTERNAL: Return the classification for the field contained in the mapping. This is used to convert the row value to a consistent Java value.- Overrides:
getFieldClassificationin classDatabaseMapping
-
getFieldClassification
public java.lang.Class getFieldClassification()
ADVANCED: Return 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.
-
setFieldClassification
public void setFieldClassification(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.
-
setFieldClassificationClassName
public void setFieldClassificationClassName(java.lang.String className)
INTERNAL: Set the name of the class that will be used for setFieldClassification and deploy time Used internally by JPA deployment.- Parameters:
className-- See Also:
setFieldClassification(Class fieldType)
-
setFieldType
public void setFieldType(int jdbcType)
ADVANCED: Set the JDBC type of the field value. This can be used if field type does not correspond directly to a Java class type, such as MONEY. This is used for binding.
-
getFieldName
public java.lang.String getFieldName()
PUBLIC: Name of the field this mapping represents.
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Convert the attribute value to a field value. Process any converter if defined, and check for null values.- Specified by:
getFieldValuein classAbstractColumnMapping
-
getForeignKeyFieldsForMapKey
public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getForeignKeyFieldsForMapKey()
INTERNAL: Return a Map of any foreign keys defined within the the MapKey.- Specified by:
getForeignKeyFieldsForMapKeyin interfaceMapKeyMapping- Returns:
-
getIdentityFieldsForMapKey
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getIdentityFieldsForMapKey()
INTERNAL: Return the fields that make up the identity of the mapped object. For mappings with a primary key, it will be the set of fields in the primary key. For mappings without a primary key it will likely be all the fields.- Specified by:
getIdentityFieldsForMapKeyin interfaceMapKeyMapping- Returns:
-
getAllFieldsForMapKey
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getAllFieldsForMapKey()
INTERNAL: Get all the fields for the map key.- Specified by:
getAllFieldsForMapKeyin interfaceMapKeyMapping
-
getNestedJoinQuery
public ObjectLevelReadQuery getNestedJoinQuery(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectLevelReadQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return the query that is used when this mapping is part of a joined relationship This method is used when this mapping is used to map the key in a Map.- Specified by:
getNestedJoinQueryin interfaceMapKeyMapping- Returns:
-
getNullValue
public java.lang.Object getNullValue()
PUBLIC: Allow for the value used for null to be specified. This can be used to convert database null values to application specific values, when null values are not allowed by the application (such as in primitives). Note: the default value for NULL is used on reads, writes, and query SQL generation
-
getAdditionalSelectionCriteriaForMapKey
public Expression getAdditionalSelectionCriteriaForMapKey()
INTERNAL: Return the selection criteria necessary to select the target object when this mapping is a map key. DirectMappings do not need any additional selection criteria when they are map keys.- Specified by:
getAdditionalSelectionCriteriaForMapKeyin interfaceMapKeyMapping- Returns:
-
getTargetVersionOfSourceObject
public java.lang.Object getTargetVersionOfSourceObject(java.lang.Object object, java.lang.Object parent, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: If required, get the targetVersion of the source object from the merge manager. Used with MapKeyContainerPolicy to abstract getting the target version of a source key.- Specified by:
getTargetVersionOfSourceObjectin interfaceMapKeyMapping- Returns:
-
getMapKeyTargetType
public java.lang.Class getMapKeyTargetType()
INTERNAL: Return the class this key mapping maps or the descriptor for it- Specified by:
getMapKeyTargetTypein interfaceMapKeyMapping- Returns:
-
getWeight
public java.lang.Integer getWeight()
INTERNAL: Return the weight of the mapping, used to sort mappings to ensure that DirectToField Mappings get merged first- Overrides:
getWeightin classDatabaseMapping
-
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 initialized and serialized reference descriptors are replaced with local descriptors if they already exist on the remote session.- Overrides:
remoteInitializationin classDatabaseMapping
-
preInitialize
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Initialize the attribute classification.- Overrides:
preInitializein classDatabaseMapping- Throws:
DescriptorException
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: The mapping is initialized with the given session. This mapping is fully initialized after this.- Overrides:
initializein classDatabaseMapping- Throws:
DescriptorException
-
internalBuildChangeRecord
public org.eclipse.persistence.internal.sessions.ChangeRecord internalBuildChangeRecord(java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner)INTERNAL: Build a change record.
-
isDirectToFieldMapping
public boolean isDirectToFieldMapping()
INTERNAL:- Overrides:
isDirectToFieldMappingin classDatabaseMapping
-
iterateOnMapKey
public void iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)INTERNAL: Called when iterating through descriptors to handle iteration on this mapping when it is used as a MapKey.- Specified by:
iterateOnMapKeyin interfaceMapKeyMapping
-
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, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.- Specified by:
mergeChangesIntoObjectin classDatabaseMapping
-
mergeIntoObject
public void mergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object. This merge is only called when a changeSet for the target does not exist or the target is uninitialized- Specified by:
mergeIntoObjectin classDatabaseMapping
-
preinitializeMapKey
public void preinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table) throws DescriptorExceptionINTERNAL: Making any mapping changes necessary to use a the mapping as a map key prior to initializing the mapping.- Specified by:
preinitializeMapKeyin interfaceMapKeyMapping- Throws:
DescriptorException
-
postInitializeMapKey
public void postInitializeMapKey(org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy policy)
INTERNAL: Making any mapping changes necessary to use a the mapping as a map key after initializing the mapping.- Specified by:
postInitializeMapKeyin interfaceMapKeyMapping
-
requiresDataModificationEventsForMapKey
public boolean requiresDataModificationEventsForMapKey()
INTERNAL: Return whether this mapping requires extra queries to update the rows if it is used as a key in a map. This will typically be true if there are any parts to this mapping that are not read-only.- Specified by:
requiresDataModificationEventsForMapKeyin interfaceMapKeyMapping
-
setAttributeClassification
public void setAttributeClassification(java.lang.Class attributeClassification)
PUBLIC: Some databases do not properly support all of the base data types. For these databases, the base data type must be explicitly specified in the mapping to tell EclipseLink to force the instance variable value to that data type
-
setAttributeClassificationName
public void setAttributeClassificationName(java.lang.String attributeClassificationName)
INTERNAL: Set the name of the class for MW usage.
-
setNullValue
public void setNullValue(java.lang.Object nullValue)
PUBLIC: Allow for the value used for null to be specified. This can be used to convert database null values to application specific values, when null values are not allowed by the application (such as in primitives). Note: the default value for NULL is used on reads, writes, and query SQL generation
-
toString
public java.lang.String toString()
INTERNAL:- Overrides:
toStringin classAbstractColumnMapping
-
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.- Overrides:
updateChangeRecordin classDatabaseMapping
-
isChangeTrackingSupported
public boolean isChangeTrackingSupported(Project project)
INTERNAL: Return if this mapping supports change tracking.- Overrides:
isChangeTrackingSupportedin classDatabaseMapping
-
isCloningRequired
public boolean isCloningRequired()
INTERNAL: Return if this mapping requires its attribute value to be cloned.- Overrides:
isCloningRequiredin classDatabaseMapping
-
unwrapKey
public java.lang.Object unwrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow the key mapping to unwrap the object.- Specified by:
unwrapKeyin interfaceMapKeyMapping- Returns:
-
validateBeforeInitialization
public void validateBeforeInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Allow for subclasses to perform validation.- Overrides:
validateBeforeInitializationin classDatabaseMapping- Throws:
DescriptorException
-
wrapKey
public java.lang.Object wrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow the key mapping to wrap the object.- Specified by:
wrapKeyin interfaceMapKeyMapping- Returns:
-
valueFromObject
public java.lang.Object valueFromObject(java.lang.Object object, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Get the value from the object for this mapping.- Overrides:
valueFromObjectin classDatabaseMapping- Throws:
DescriptorException
-
buildShallowOriginalFromRow
public void buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, java.lang.Object original, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: Builds a shallow original object. Only direct attributes and primary keys are populated. In this way the minimum original required for instantiating a working copy clone can be built without placing it in the shared cache (no concern over cycles).- Overrides:
buildShallowOriginalFromRowin classDatabaseMapping- Parameters:
original- later the input to buildCloneFromRow
-
valueFromRow
public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected, java.lang.Boolean[] wasCacheUsed)INTERNAL: Return the mapping's attribute value from the row. The execution session is passed for the case of building a UnitOfWork clone directly from a row, the session set in the query will not know which platform to use for converting the value. Allows the correct session to be passed in.- Overrides:
valueFromRowin classDatabaseMapping
-
valueFromResultSet
public java.lang.Object valueFromResultSet(java.sql.ResultSet resultSet, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor accessor, java.sql.ResultSetMetaData metaData, int columnNumber, org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform) throws java.sql.SQLExceptionINTERNAL: Returns the value for the mapping directly from the result-set. PERF: Used for optimized object building.- Overrides:
valueFromResultSetin classDatabaseMapping- Throws:
java.sql.SQLException
-
writeValueIntoRow
protected abstract void writeValueIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.Object value)Description copied from class:AbstractColumnMappingINTERNAL:- Specified by:
writeValueIntoRowin classAbstractColumnMapping
-
writeFromObjectIntoRowWithChangeRecord
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: Get a value from the object and set that in the respective field of the row. Validation preventing primary key updates is implemented here.- Overrides:
writeFromObjectIntoRowWithChangeRecordin classDatabaseMapping
-
writeFromObjectIntoRow
public void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
writeFromObjectIntoRowin classDatabaseMapping
-
writeFromObjectIntoRowForUpdate
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
INTERNAL: Write the attribute value from the object to the row for update.- Overrides:
writeFromObjectIntoRowForUpdatein classDatabaseMapping
-
writeInsertFieldsIntoRow
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Write fields needed for insert into the template for with null values.- Overrides:
writeInsertFieldsIntoRowin classDatabaseMapping
-
writeUpdateFieldsIntoRow
public void writeUpdateFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Write fields needed for update into the template for with null values. By default inserted fields are used.- Overrides:
writeUpdateFieldsIntoRowin classDatabaseMapping
-
getFieldClassificationClassName
public java.lang.String getFieldClassificationClassName()
INTERNAL: Get fieldClassificationClassName. Value usually exist for fields with some kind of embedded converter like@Lobor@Temporal.
-
-