Class EISOneToOneMapping
- 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.ForeignReferenceMapping
-
- org.eclipse.persistence.mappings.ObjectReferenceMapping
-
- org.eclipse.persistence.eis.mappings.EISOneToOneMapping
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EISMapping
public class EISOneToOneMapping extends ObjectReferenceMapping implements EISMapping
An EIS one-to-one mapping is a reference mapping that represents the relationship between a single source object and a single mapped persistent Java object. The source object usually contains a foreign key (pointer) to the target object (key on source); alternatively, the target object may contain a foreign key to the source object (key on target). Because both the source and target objects use interactions, they must both be configured as root object types.
Record Type Description Indexed Ordered collection of record elements. The indexed record EIS format enables Java class attribute values to be retrieved by position or index. Mapped Key-value map based representation of record elements. The mapped record EIS format enables Java class attribute values to be retrieved by an object key. XML Record/Map representation of an XML DOM element. - Since:
- Oracle TopLink 10g Release 2 (10.1.3)
- See Also:
EISDescriptor.useIndexedRecordFormat()
,EISDescriptor.useMappedRecordFormat()
,EISDescriptor.useXMLRecordFormat()
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
INNER_JOIN, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description EISOneToOneMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField targetKeyField)
PUBLIC: Define the source foreign key relationship in the one-to-one mapping.void
addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName)
PUBLIC: Define the source foreign key relationship in the one-to-one mapping.Object
clone()
INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones.Object
extractPrimaryKeysForReferenceObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: Return the primary key for the reference object (i.e.Class
getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
INTERNAL: Return the classifiction for the field contained in the mapping.Expression
getPrivateOwnedCriteria()
INTERNAL: The private owned criteria is only used outside of the unit of work to compare the previous value of the reference.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField>
getSourceToTargetKeyFields()
INTERNAL: Gets the foreign key fields.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField>
getTargetToSourceKeyFields()
INTERNAL: Gets the target foreign key fields.void
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize the mapping.boolean
isEISMapping()
INTERNAL:boolean
isOneToOneMapping()
INTERNAL:void
setSelectionSQLString(String sqlString)
INTERNAL: This method is not supported in an EIS environment.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
setSourceToTargetKeyFields(Map sourceToTargetKeyFields)
INTERNAL: Set the source keys to target keys fields association.void
setTargetToSourceKeyFields(Map 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.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 session, boolean isTargetProtected, Boolean[] wasCacheUsed)
INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.void
writeFromObjectIntoRow(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord Record, 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.-
Methods inherited from class org.eclipse.persistence.mappings.ObjectReferenceMapping
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildExpression, buildReferencesPKList, buildTargetInterfaces, buildUnitofWorkCloneForPartObject, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, cascadeRegisterNewIfRequired, collectQueryParameters, compareForChange, createCloneValueHolder, earlyPreDelete, extractPrimaryKeyRowForSourceObject, extractPrimaryKeysForReferenceObject, extractPrimaryKeysFromRealReferenceObject, fixRealObjectReferences, getDescriptorForTarget, getForeignKeyFields, getRealAttributeValueFromAttribute, hasConstraintDependency, hasRelationTableMechanism, internalBuildChangeRecord, isChangeTrackingSupported, isForeignKeyRelationship, isObjectReferenceMapping, iterateOnRealAttributeValue, loadAll, mergeChangesIntoObject, mergeIntoObject, postCalculateChanges, postDelete, postInsert, postUpdate, preDelete, preInitialize, preInsert, preUpdate, recordPrivateOwnedRemovals, setIsForeignKeyRelationship, setNewValueInChangeRecord, updateChangeRecord, updateChangeRecordForSelfMerge, useProxyIndirection, useProxyIndirection, useProxyIndirection, valueFromPKList, verifyDelete, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForWhereClause
-
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
addTargetForeignKeyField, buildBackupClone, buildClone, buildCloneFromRow, compareObjects, convertClassNamesToClasses, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, extractResultFromBatchQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getFieldsForTranslationInAggregate, getIndirectionPolicy, getJoinCriteria, getJoinFetch, getMappedBy, getObjectCorrespondingTo, getOrderByNormalizedExpressions, 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, isJoiningSupported, 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, setShouldExtendPessimisticLockScope, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldMergeCascadeParts, shouldRefreshCascadeParts, shouldUseBatchReading, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, validateBeforeInitialization
-
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, 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, isCascadedLockingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isOneToManyMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRelationalMapping, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitialize, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, 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, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
-
-
-
-
Method Detail
-
isEISMapping
public boolean isEISMapping()
INTERNAL:- Overrides:
isEISMapping
in classDatabaseMapping
-
isOneToOneMapping
public boolean isOneToOneMapping()
INTERNAL:- Overrides:
isOneToOneMapping
in classDatabaseMapping
-
addForeignKeyField
public void addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField targetKeyField)
PUBLIC: Define the source foreign key relationship in the one-to-one mapping. This method is used to add foreign key relationships to the mapping. Both the source foreign key field name and the corresponding target primary key field name must be specified.- Overrides:
addForeignKeyField
in classForeignReferenceMapping
-
addForeignKeyFieldName
public void addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName)
PUBLIC: Define the source foreign key relationship in the one-to-one mapping. This method is used to add foreign key relationships to the mapping. Both the source foreign key field name and the corresponding target primary key field name must be specified.
-
clone
public Object clone()
INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones.- Overrides:
clone
in classForeignReferenceMapping
-
extractPrimaryKeysForReferenceObjectFromRow
public 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). This key will be used by a RemoteValueHolder.- Overrides:
extractPrimaryKeysForReferenceObjectFromRow
in classObjectReferenceMapping
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
INTERNAL: Initialize the mapping.- Overrides:
initialize
in classForeignReferenceMapping
- Throws:
DescriptorException
-
valueFromRow
public 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 session, boolean isTargetProtected, Boolean[] wasCacheUsed) throws DatabaseException
INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object. Check for batch + aggregation reading.- Overrides:
valueFromRow
in classForeignReferenceMapping
- Throws:
DatabaseException
-
writeFromObjectIntoRow
public void writeFromObjectIntoRow(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord Record, 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:
writeFromObjectIntoRow
in classDatabaseMapping
-
getFieldClassification
public Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify) throws DescriptorException
INTERNAL: Return the classifiction for the field contained in the mapping. This is used to convert the row value to a consistent java value.- Overrides:
getFieldClassification
in classDatabaseMapping
- Throws:
DescriptorException
-
getPrivateOwnedCriteria
public Expression getPrivateOwnedCriteria()
INTERNAL: The private owned criteria is only used outside of the unit of work to compare the previous value of the reference.
-
setShouldVerifyDelete
public 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. It checks for the previous value of the target object through joining the source and target tables. By default it is always done, but may be disabled for performance on distributed database reasons. In the unit of work the previous value is obtained from the backup-clone so it is never used.- Parameters:
shouldVerifyDelete
- Sets whether delete verification should be performed
-
shouldVerifyDelete
public boolean shouldVerifyDelete()
PUBLIC: Verify delete is used during delete and update outside of a unit of work only. It checks for the previous value of the target object through joining the source and target tables.- Returns:
- TRUE if verify delete has been enabled
-
getSourceToTargetKeyFields
public Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getSourceToTargetKeyFields()
INTERNAL: Gets the foreign key fields.- Returns:
- The mapping from source to target key fields
-
getTargetToSourceKeyFields
public Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getTargetToSourceKeyFields()
INTERNAL: Gets the target foreign key fields.- Returns:
- The mapping from target to source key fields
-
setSourceToTargetKeyFields
public void setSourceToTargetKeyFields(Map sourceToTargetKeyFields)
INTERNAL: Set the source keys to target keys fields association.- Parameters:
sourceToTargetKeyFields
- The mapping from source keys to target keys
-
setTargetToSourceKeyFields
public void setTargetToSourceKeyFields(Map targetToSourceKeyFields)
INTERNAL: Set the target keys to source keys fields association.- Parameters:
targetToSourceKeyFields
- The mapping from target keys to source keys
-
setSelectionSQLString
public void setSelectionSQLString(String sqlString)
INTERNAL: This method is not supported in an EIS environment.- Overrides:
setSelectionSQLString
in classForeignReferenceMapping
-
-