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. |
EISDescriptor.useIndexedRecordFormat(),
EISDescriptor.useMappedRecordFormat(),
EISDescriptor.useXMLRecordFormat(),
Serialized FormDatabaseMapping.WriteType| Modifier and Type | Field and Description |
|---|---|
protected Expression |
privateOwnedCriteria |
protected boolean |
shouldVerifyDelete
These are used for non-unit of work modification to check if the value of the 1-1 was changed and a deletion is required.
|
protected Map |
sourceToTargetKeyFields
Maps the source foreign/primary key fields to the target primary/foreign key fields.
|
protected Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
targetToSourceKeyFields
Maps the target primary/foreign key fields to the source foreign/primary key fields.
|
foreignKeyFields, isForeignKeyRelationshipbatchFetchType, cascadeDetach, cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isCascadeOnDeleteSetOnDatabase, isPrivateOwned, joinFetch, mappedBy, NONE, OUTER_JOIN, partitioningPolicy, partitioningPolicyName, QUERY_BATCH_PARAMETER, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSessionattributeAccessor, 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 and Description |
|---|
EISOneToOneMapping() |
| Modifier and Type | Method and 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.
|
protected void |
initializeForeignKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
The foreign keys primary keys are stored as database fields in the hashtable.
|
protected void |
initializePrivateOwnedCriteria()
INTERNAL:
Selection criteria is created with source foreign keys and target keys.
|
protected void |
initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Selection criteria is created with source foreign keys and target keys.
|
boolean |
isEISMapping()
INTERNAL:
|
boolean |
isOneToOneMapping()
INTERNAL:
|
protected Object |
readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery)
INTERNAL:
Reads the private owned object.
|
protected void |
setPrivateOwnedCriteria(Expression expression)
INTERNAL:
Private owned criteria is used to verify the deletion of the target.
|
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.
|
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildExpression, buildReferencesPKList, buildTargetInterfaces, buildUnitofWorkCloneForPartObject, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, cascadeRegisterNewIfRequired, collectFields, collectQueryParameters, compareForChange, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, createCloneValueHolder, earlyPreDelete, extractPrimaryKeyRowForSourceObject, extractPrimaryKeysForReferenceObject, extractPrimaryKeysFromRealReferenceObject, fixRealObjectReferences, getDescriptorForTarget, getForeignKeyFields, getPrimaryKeyForObject, getRealAttributeValueFromAttribute, hasConstraintDependency, hasRelationTableMechanism, insert, internalBuildChangeRecord, isChangeTrackingSupported, isForeignKeyRelationship, isObjectReferenceMapping, iterateOnRealAttributeValue, loadAll, mergeChangesIntoObject, mergeIntoObject, postCalculateChanges, postDelete, postInsert, postUpdate, preDelete, preInitialize, preInsert, preUpdate, recordPrivateOwnedRemovals, setForeignKeyFields, setIsForeignKeyRelationship, setNewValueInChangeRecord, update, updateChangeRecord, updateChangeRecordForSelfMerge, useProxyIndirection, useProxyIndirection, useProxyIndirection, valueFromPKList, verifyDelete, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForWhereClauseaddTargetForeignKeyField, batchedValueFromRow, buildBackupClone, buildBatchCriteria, buildClone, buildCloneFromRow, checkCacheForBatchKey, compareObjects, convertClassNamesToClasses, dontDoMerge, dontUseBatchReading, dontUseIndirection, executeBatchQuery, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, extractBatchKeyFromRow, extractResultFromBatchQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getExtendPessimisticLockScopeDedicatedQuery, getFieldsForTranslationInAggregate, getIndirectionPolicy, getJoinCriteria, getJoinFetch, getMappedBy, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getPartitioningPolicy, getPartitioningPolicyName, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, hasNestedIdentityReference, initializeReferenceDescriptor, initializeSelectionQuery, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isJoiningSupported, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, load, mergeRemoteValueHolder, postPrepareNestedBatchQuery, prepareHistoricalQuery, prepareNestedBatchQuery, prepareNestedJoinQueryClone, prepareNestedJoins, privateOwnedRelationship, readFromRowIntoObject, remoteInitialization, replaceValueHoldersIn, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionQuery, setShouldExtendPessimisticLockScope, setTempSession, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldObjectModifyCascadeToParts, shouldRefreshCascadeParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, validateBeforeInitialization, valueFromRowInternal, valueFromRowInternal, valueFromRowInternalWithJoinaddUnconvertedProperty, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cloneFields, convertConverterClassNamesToClasses, derivesId, extractNestedExpressions, extractNestedNonAggregateExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, 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, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitialize, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, 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, writeUpdateFieldsIntoRowprotected Map sourceToTargetKeyFields
protected Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetToSourceKeyFields
protected boolean shouldVerifyDelete
protected transient Expression privateOwnedCriteria
public boolean isEISMapping()
isEISMapping in class DatabaseMappingpublic boolean isOneToOneMapping()
isOneToOneMapping in class DatabaseMappingpublic void addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField,
org.eclipse.persistence.internal.helper.DatabaseField targetKeyField)
addForeignKeyField in class ForeignReferenceMappingpublic void addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName)
public Object clone()
clone in class ForeignReferenceMappingpublic Object extractPrimaryKeysForReferenceObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row)
extractPrimaryKeysForReferenceObjectFromRow in class ObjectReferenceMappingpublic void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
initialize in class ForeignReferenceMappingDescriptorExceptionprotected void initializeForeignKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected Object readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery) throws DatabaseException
readPrivateOwnedForObject in class ObjectReferenceMappingDatabaseExceptionprotected void initializePrivateOwnedCriteria()
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
valueFromRow in class ForeignReferenceMappingDatabaseExceptionpublic void writeFromObjectIntoRow(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord Record, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow in class DatabaseMappingpublic Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify) throws DescriptorException
getFieldClassification in class DatabaseMappingDescriptorExceptionpublic Expression getPrivateOwnedCriteria()
protected void setPrivateOwnedCriteria(Expression expression)
public void setShouldVerifyDelete(boolean shouldVerifyDelete)
shouldVerifyDelete - Sets whether delete verification should be performedpublic boolean shouldVerifyDelete()
public Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getSourceToTargetKeyFields()
public Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getTargetToSourceKeyFields()
public void setSourceToTargetKeyFields(Map sourceToTargetKeyFields)
sourceToTargetKeyFields - The mapping from source keys to target keyspublic void setTargetToSourceKeyFields(Map targetToSourceKeyFields)
targetToSourceKeyFields - The mapping from target keys to source keyspublic void setSelectionSQLString(String sqlString)
setSelectionSQLString in class ForeignReferenceMappingCopyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.