public class OneToOneMapping extends ObjectReferenceMapping implements RelationalMapping, MapKeyMapping
Purpose: One to one mappings are used to represent a pointer references between two java objects. This mappings is usually represented by a single pointer (stored in an instance variable) between the source and target objects. In the relational database tables, these mappings are normally implemented using foreign keys.
DatabaseMapping.WriteType| Modifier and Type | Field and Description |
|---|---|
org.eclipse.persistence.internal.helper.DatabaseTable |
keyTableForMapKey |
INNER_JOIN, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER| Constructor and Description |
|---|
OneToOneMapping()
PUBLIC: Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
INTERNAL: Used when initializing queries for mappings that use a Map.
|
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
|
void |
addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField targetPrimaryKeyField)
PUBLIC: Define the foreign key relationship in the 1-1 mapping.
|
void |
addForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetPrimaryKeyFieldName)
PUBLIC: Define the foreign key relationship in the 1-1 mapping.
|
void |
addKeyToDeletedObjectsList(java.lang.Object object, java.util.Map deletedObjects)
INTERNAL: For mappings used as MapKeys in MappedKeyContainerPolicy.
|
void |
addTargetForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField targetForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField sourcePrimaryKeyField)
PUBLIC: Define the target foreign key relationship in the 1-1 mapping.
|
void |
addTargetForeignKeyFieldName(java.lang.String targetForeignKeyFieldName, java.lang.String sourcePrimaryKeyFieldName)
PUBLIC: Define the target foreign key relationship in the 1-1 mapping.
|
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.
|
Expression |
buildObjectJoinExpression(Expression expression, Expression argument, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Used to allow object level comparisons.
|
Expression |
buildObjectJoinExpression(Expression expression, java.lang.Object value, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Used to allow object level comparisons.
|
Expression |
buildSelectionCriteria()
This method would allow customers to get the potential selection criteria for a mapping prior to initialization.
|
Expression |
buildSelectionCriteria(boolean useParameter, boolean usePreviousSelectionCriteria)
INTERNAL: Build the selection criteria for this mapping.
|
ReadQuery |
buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL: Certain key mappings favor different types of selection query.
|
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.
|
java.lang.Object |
clone()
INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones.
|
void |
collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)
INTERNAL: This method is used to store the FK fields that can be cached that correspond to noncacheable mappings the FK field values will be used to re-issue the query when cloning the shared cache entity
|
java.lang.Object |
createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, 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.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.
|
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.
|
QueryKey |
createQueryKeyForMapKey()
INTERNAL: Create a query key that links to the map key
|
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.
|
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.
|
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.
|
void |
extendPessimisticLockScopeInSourceQuery(ObjectLevelReadQuery sourceQuery)
INTERNAL: Called only if both shouldExtendPessimisticLockScope and shouldExtendPessimisticLockScopeInSourceQuery are true.
|
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
|
java.lang.Object |
extractPrimaryKeysForReferenceObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: Return the primary key for the reference object (i.e. the object object referenced by domainObject and specified by mapping).
|
Expression |
getAdditionalSelectionCriteriaForMapKey()
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.Class |
getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
INTERNAL: Return the classification for the field contained in the mapping.
|
java.util.Collection |
getFieldsForTranslationInAggregate()
INTERNAL: Return source key fields for translation by an AggregateObjectMapping
|
java.util.Vector |
getForeignKeyFieldNames()
PUBLIC: Return the foreign key field names associated with the mapping.
|
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.Class |
getMapKeyTargetType()
INTERNAL: Return the class this key mapping maps or the descriptor for it
|
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
|
java.util.List<Expression> |
getOrderByNormalizedExpressions(Expression base)
INTERNAL: Order by foreign key fields if a foreign key mapping (avoids joins).
|
java.util.Vector |
getOrderedForeignKeyFields()
INTERNAL: Return a vector of the foreign key fields in the same order as the corresponding primary key fields are in their descriptor.
|
Expression |
getPrivateOwnedCriteria()
INTERNAL: The private owned criteria is only used outside of the unit of work to compare the previous value of the reference.
|
org.eclipse.persistence.internal.helper.DatabaseTable |
getRelationTable()
PUBLIC: Return RelationTable.
|
RelationTableMechanism |
getRelationTableMechanism()
PUBLIC: Returns RelationTableMechanism that may be owned by the mapping, that allows to configure the mapping to use relation table (just like ManyToManyMapping).
|
java.util.Vector |
getSourceToTargetKeyFieldAssociations()
INTERNAL: Return a collection of the source to target field value associations.
|
java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
getSourceToTargetKeyFields()
INTERNAL: Returns the source keys to target keys fields association.
|
java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
getTargetToSourceKeyFields()
INTERNAL: Returns the target keys to source keys fields association.
|
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
|
boolean |
hasRelationTable()
PUBLIC: Indicates whether the mapping has RelationTable.
|
boolean |
hasRelationTableMechanism()
PUBLIC: Indicates whether the mapping has RelationTableMechanism.
|
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize the mapping.
|
boolean |
isCascadedLockingSupported()
INTERNAL Return true if this mapping supports cascaded version optimistic locking.
|
boolean |
isJoiningSupported()
INTERNAL: Return if this mapping support joining.
|
boolean |
isOneToOneMapping()
INTERNAL:
|
boolean |
isOneToOnePrimaryKeyRelationship()
Return if this mapping is mapped using primary key join columns.
|
boolean |
isOneToOneRelationship()
Return if this mapping is really for a OneToOne relationship.
|
boolean |
isOwned()
INTERNAL:
|
boolean |
isRelationalMapping()
INTERNAL:
|
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
|
void |
performDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Perform the commit event.
|
void |
postInitializeMapKey(org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy policy)
INTERNAL: Need to set the field type for the foreign key fields for a map key, as the fields are not contained in any descriptor.
|
void |
postInitializeSourceAndTargetExpressions()
INTERNAL: Post-initialize source and target expression fields created when a mapping's selectionCriteria is created early with only partly initialized fields.
|
void |
postInsert(WriteObjectQuery query)
INTERNAL: Insert into relation table.
|
void |
postUpdate(WriteObjectQuery query)
INTERNAL: Update the relation table with the entries related to this mapping.
|
void |
preDelete(DeleteObjectQuery query)
INTERNAL: Delete privately owned parts
|
void |
preinitializeMapKey(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
|
void |
prepareCascadeLockingPolicy()
INTERNAL: Prepare a cascade locking policy.
|
void |
rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Rehash any map based on fields.
|
boolean |
requiresDataModificationEventsForMapKey()
INTERNAL: Return whether this mapping requires extra queries to update the rows if it is used as a key in a map.
|
void |
setForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName)
PUBLIC: Define the foreign key relationship in the 1-1 mapping.
|
void |
setForeignKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Return the foreign key field names associated with the mapping.
|
void |
setIsOneToOnePrimaryKeyRelationship(boolean isOneToOnePrimaryKeyRelationship)
Set if this mapping is defined using primary key join columns.
|
void |
setIsOneToOneRelationship(boolean isOneToOneRelationship)
Define if this mapping is really for a OneToOne relationship.
|
void |
setRelationTable(org.eclipse.persistence.internal.helper.DatabaseTable relationTable)
PUBLIC: Set the relational table.
|
void |
setRelationTableMechanism(RelationTableMechanism mechanism)
PUBLIC: Set RelationTableMechanism into the mapping, that allows to configure the mapping to use relation table (just like ManyToManyMapping).
|
void |
setShouldVerifyDelete(boolean shouldVerifyDelete)
PUBLIC: Verify delete is used during delete and update on private 1:1's outside of a unit of work only.
|
void |
setSourceToTargetKeyFieldAssociations(java.util.Vector sourceToTargetKeyFieldAssociations)
INTERNAL: Set a collection of the source to target field associations.
|
void |
setSourceToTargetKeyFields(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> sourceToTargetKeyFields)
INTERNAL: Set the source keys to target keys fields association.
|
void |
setTargetForeignKeyFieldName(java.lang.String targetForeignKeyFieldName)
PUBLIC: Define the target foreign key relationship in the 1-1 mapping.
|
void |
setTargetToSourceKeyFields(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetToSourceKeyFields)
INTERNAL: Set the target keys to source keys fields association.
|
boolean |
shouldVerifyDelete()
PUBLIC: Verify delete is used during delete and update outside of a unit of work only.
|
java.lang.Object |
unwrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow the key mapping to unwrap the object.
|
java.lang.Object |
valueFromObject(java.lang.Object object, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Get a value from the object and set that in the respective field of the row.
|
java.lang.Object |
wrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow the key mapping to wrap the object.
|
void |
writeFromAttributeIntoRow(java.lang.Object attribute, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: A subclass should implement this method if it wants different behavior.
|
void |
writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, 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.
|
void |
writeFromObjectIntoRowForShallowInsert(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord ChangeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForUpdateAfterShallowInsert(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: This row is built for update after shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForUpdateBeforeShallowDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: This row is built for update before shallow delete which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, 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.
|
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.
|
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildExpression, buildReferencesPKList, buildTargetInterfaces, buildUnitofWorkCloneForPartObject, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, cascadeRegisterNewIfRequired, compareForChange, createCloneValueHolder, earlyPreDelete, extractPrimaryKeyRowForSourceObject, extractPrimaryKeysForReferenceObject, extractPrimaryKeysFromRealReferenceObject, fixRealObjectReferences, getDescriptorForTarget, getForeignKeyFields, getRealAttributeValueFromAttribute, hasConstraintDependency, internalBuildChangeRecord, isChangeTrackingSupported, isForeignKeyRelationship, isObjectReferenceMapping, iterateOnRealAttributeValue, loadAll, mergeChangesIntoObject, mergeIntoObject, postCalculateChanges, postDelete, preInitialize, preInsert, preUpdate, recordPrivateOwnedRemovals, setIsForeignKeyRelationship, setNewValueInChangeRecord, updateChangeRecord, updateChangeRecordForSelfMerge, useProxyIndirection, useProxyIndirection, useProxyIndirection, valueFromPKList, verifyDelete, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForWhereClausebuildBackupClone, buildClone, buildCloneFromRow, compareObjects, convertClassNamesToClasses, dontUseBatchReading, dontUseIndirection, extractResultFromBatchQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getIndirectionPolicy, getJoinCriteria, getJoinFetch, getMappedBy, getObjectCorrespondingTo, getPartitioningPolicy, getPartitioningPolicyName, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, hasNestedIdentityReference, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, load, mergeRemoteValueHolder, prepareNestedBatchQuery, prepareNestedJoins, privateOwnedRelationship, readFromRowIntoObject, remoteInitialization, replaceValueHoldersIn, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionSQLString, setShouldExtendPessimisticLockScope, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldMergeCascadeParts, shouldRefreshCascadeParts, shouldUseBatchReading, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, validateBeforeInitialization, valueFromRowaddUnconvertedProperty, buildContainerClone, calculateDeferredChanges, derivesId, getAttributeAccessor, getAttributeClassification, getAttributeName, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasInverseConstraintDependency, hasMapsIdValue, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isOneToManyMapping, isOptional, isOutOnlySopObject, isOutSopObject, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, postCalculateChangesOnDeleted, postInitialize, readFromResultSetIntoObject, readOnly, readWrite, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, valueFromResultSet, valueFromRow, writeUpdateFieldsIntoRowequals, getClass, hashCode, notify, notifyAll, wait, wait, waitcascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, getReferenceDescriptorpublic org.eclipse.persistence.internal.helper.DatabaseTable keyTableForMapKey
public boolean isRelationalMapping()
isRelationalMapping in class DatabaseMappingpublic void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
addAdditionalFieldsToQuery in interface MapKeyMappingpublic void addFieldsForMapKey(org.eclipse.persistence.internal.sessions.AbstractRecord joinRow)
addFieldsForMapKey in interface MapKeyMapping
public void addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField,
org.eclipse.persistence.internal.helper.DatabaseField targetPrimaryKeyField)
addForeignKeyField in class ForeignReferenceMapping
public void addForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetPrimaryKeyFieldName)
public void addTargetForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField targetForeignKeyField,
org.eclipse.persistence.internal.helper.DatabaseField sourcePrimaryKeyField)
addTargetForeignKeyField in class ForeignReferenceMapping
public void addTargetForeignKeyFieldName(java.lang.String targetForeignKeyFieldName,
java.lang.String sourcePrimaryKeyFieldName)
public void addKeyToDeletedObjectsList(java.lang.Object object,
java.util.Map deletedObjects)
addKeyToDeletedObjectsList in interface MapKeyMapping
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)
buildElementClone in interface MapKeyMappingpublic Expression buildObjectJoinExpression(Expression expression, java.lang.Object value, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildObjectJoinExpression in class DatabaseMappingpublic Expression buildObjectJoinExpression(Expression expression, Expression argument, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildObjectJoinExpression in class DatabaseMappingpublic ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
buildSelectionQueryForDirectCollectionKeyMapping in interface MapKeyMappingpublic java.lang.Object clone()
clone in interface MapComponentMappingclone in class ForeignReferenceMappingpublic void collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)
ObjectReferenceMappingcollectQueryParameters in class ObjectReferenceMapping
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)
createMapComponentFromRow in interface MapComponentMapping
public java.lang.Object createSerializableMapKeyInfo(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
createSerializableMapKeyInfo in interface MapKeyMapping
public java.util.List<java.lang.Object> createMapComponentsFromSerializableKeyInfo(java.lang.Object[] keyInfo,
org.eclipse.persistence.internal.sessions.AbstractSession session)
createMapComponentsFromSerializableKeyInfo in interface MapKeyMapping
public java.lang.Object createStubbedMapComponentFromSerializableKeyInfo(java.lang.Object keyInfo,
org.eclipse.persistence.internal.sessions.AbstractSession session)
createStubbedMapComponentFromSerializableKeyInfo in interface MapKeyMapping
public java.lang.Object createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
org.eclipse.persistence.internal.sessions.AbstractSession session,
boolean isTargetProtected)
createMapComponentFromJoinedRow in interface MapKeyMappingpublic QueryKey createQueryKeyForMapKey()
createQueryKeyForMapKey in interface MapKeyMapping
public void deleteMapKey(java.lang.Object objectDeleted,
org.eclipse.persistence.internal.sessions.AbstractSession session)
deleteMapKey in interface MapKeyMappingobjectDeleted -session -public void extendPessimisticLockScopeInSourceQuery(ObjectLevelReadQuery sourceQuery)
extendPessimisticLockScopeInSourceQuery in class ForeignReferenceMapping
public java.util.Map extractIdentityFieldsForQuery(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
extractIdentityFieldsForQuery in interface MapKeyMappingpublic java.lang.Object extractPrimaryKeysForReferenceObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row)
extractPrimaryKeysForReferenceObjectFromRow in class ObjectReferenceMappingpublic Expression getAdditionalSelectionCriteriaForMapKey()
getAdditionalSelectionCriteriaForMapKey in interface MapKeyMappingpublic java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable> getAdditionalTablesForJoinQuery()
getAdditionalTablesForJoinQuery in interface MapKeyMapping
public java.lang.Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
throws DescriptorException
getFieldClassification in class DatabaseMappingDescriptorExceptionpublic java.util.Vector getForeignKeyFieldNames()
public java.util.Collection getFieldsForTranslationInAggregate()
getFieldsForTranslationInAggregate in class ForeignReferenceMappingpublic java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getForeignKeyFieldsForMapKey()
getForeignKeyFieldsForMapKey in interface MapKeyMappingpublic java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getIdentityFieldsForMapKey()
getIdentityFieldsForMapKey in interface MapKeyMappingpublic ObjectLevelReadQuery getNestedJoinQuery(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectLevelReadQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
getNestedJoinQuery in interface MapKeyMappingpublic java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getAllFieldsForMapKey()
getAllFieldsForMapKey in interface MapKeyMappingpublic java.util.Vector getOrderedForeignKeyFields()
public Expression getPrivateOwnedCriteria()
public java.util.Vector getSourceToTargetKeyFieldAssociations()
public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getSourceToTargetKeyFields()
public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getTargetToSourceKeyFields()
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)
getTargetVersionOfSourceObject in interface MapKeyMappingpublic java.lang.Class getMapKeyTargetType()
getMapKeyTargetType in interface MapKeyMapping
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
initialize in class ForeignReferenceMappingDescriptorException
public void preinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table)
throws DescriptorException
preinitializeMapKey in interface MapKeyMappingDescriptorExceptionpublic void postInitializeMapKey(org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy policy)
postInitializeMapKey in interface MapKeyMappingpublic void postInitializeSourceAndTargetExpressions()
public void prepareCascadeLockingPolicy()
prepareCascadeLockingPolicy in class DatabaseMappingpublic Expression buildSelectionCriteria()
public Expression buildSelectionCriteria(boolean useParameter, boolean usePreviousSelectionCriteria)
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)
buildShallowOriginalFromRow in class DatabaseMappingpublic boolean isOneToOneMapping()
isOneToOneMapping in class DatabaseMappingpublic boolean isOwned()
isOwned in class DatabaseMappingpublic void rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
rehashFieldDependancies in class DatabaseMappingpublic boolean requiresDataModificationEventsForMapKey()
requiresDataModificationEventsForMapKey in interface MapKeyMappingpublic boolean isOneToOneRelationship()
public boolean isOneToOnePrimaryKeyRelationship()
public void setIsOneToOneRelationship(boolean isOneToOneRelationship)
public void setIsOneToOnePrimaryKeyRelationship(boolean isOneToOnePrimaryKeyRelationship)
public void setForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName)
public void setForeignKeyFieldNames(java.util.Vector fieldNames)
public void setShouldVerifyDelete(boolean shouldVerifyDelete)
public void setSourceToTargetKeyFieldAssociations(java.util.Vector sourceToTargetKeyFieldAssociations)
public void setSourceToTargetKeyFields(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> sourceToTargetKeyFields)
public void setTargetForeignKeyFieldName(java.lang.String targetForeignKeyFieldName)
public void setTargetToSourceKeyFields(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetToSourceKeyFields)
public boolean shouldVerifyDelete()
public boolean isCascadedLockingSupported()
isCascadedLockingSupported in class DatabaseMappingpublic boolean isJoiningSupported()
isJoiningSupported in class ForeignReferenceMapping
public void iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator,
java.lang.Object element)
iterateOnMapKey in interface MapKeyMapping
public java.lang.Object unwrapKey(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
unwrapKey in interface MapKeyMapping
public java.lang.Object wrapKey(java.lang.Object key,
org.eclipse.persistence.internal.sessions.AbstractSession session)
wrapKey in interface MapKeyMapping
public void writeFromAttributeIntoRow(java.lang.Object attribute,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromAttributeIntoRow in class DatabaseMapping
public java.lang.Object valueFromObject(java.lang.Object object,
org.eclipse.persistence.internal.helper.DatabaseField field,
org.eclipse.persistence.internal.sessions.AbstractSession session)
valueFromObject in class DatabaseMapping
public void writeFromObjectIntoRow(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsert(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRowForShallowInsert in class DatabaseMapping
public void writeFromObjectIntoRowForUpdateAfterShallowInsert(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.helper.DatabaseTable table)
writeFromObjectIntoRowForUpdateAfterShallowInsert in class DatabaseMapping
public void writeFromObjectIntoRowForUpdateBeforeShallowDelete(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.helper.DatabaseTable table)
writeFromObjectIntoRowForUpdateBeforeShallowDelete in class DatabaseMapping
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord ChangeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRowForShallowInsertWithChangeRecord in class DatabaseMapping
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
writeInsertFieldsIntoRow in class DatabaseMappingpublic boolean hasRelationTableMechanism()
hasRelationTableMechanism in class ObjectReferenceMappingpublic boolean hasRelationTable()
public RelationTableMechanism getRelationTableMechanism()
public void setRelationTable(org.eclipse.persistence.internal.helper.DatabaseTable relationTable)
public void setRelationTableMechanism(RelationTableMechanism mechanism)
public org.eclipse.persistence.internal.helper.DatabaseTable getRelationTable()
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete in class ObjectReferenceMappingDatabaseExceptionOptimisticLockExceptionpublic void postInsert(WriteObjectQuery query) throws DatabaseException
- Extract primary key and its value from the source object.
- Extract target key and its value from the target object.
- Construct a insert statement with above fields and values for relation table.
- execute the statement.
postInsert in class ObjectReferenceMappingDatabaseExceptionpublic void postUpdate(WriteObjectQuery query) throws DatabaseException
postUpdate in class ObjectReferenceMappingDatabaseException
public void performDataModificationEvent(java.lang.Object[] event,
org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DatabaseException,
DescriptorException
performDataModificationEvent in class DatabaseMappingDatabaseExceptionDescriptorExceptionpublic java.util.List<Expression> getOrderByNormalizedExpressions(Expression base)
getOrderByNormalizedExpressions in class ForeignReferenceMapping