public class VariableOneToOneMapping extends ObjectReferenceMapping implements RelationalMapping
Purpose: Variable one to one mappings are used to represent a pointer references between a java object and an implementer of an interface. This mapping 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 a foreign key and a type code.
DatabaseMapping.WriteTypeINNER_JOIN, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER| Constructor and Description |
|---|
VariableOneToOneMapping()
PUBLIC:
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClassIndicator(java.lang.Class implementer,
java.lang.Object typeIndicator)
PUBLIC:
Add a type indicator conversion to this mapping.
|
void |
addClassNameIndicator(java.lang.String className,
java.lang.Object typeIndicator)
INTERNAL:
Add indicators by classname.
|
void |
addForeignQueryKeyName(DatabaseField sourceForeignKeyField,
java.lang.String targetQueryKeyName)
PUBLIC:
A foreign key from the source table and abstract query key from the interface descriptor are added to the
mapping.
|
void |
addForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetQueryKeyName)
PUBLIC:
A foreign key from the source table and abstract query key from the interface descriptor are added to the
mapping.
|
void |
addTargetForeignQueryKeyName(java.lang.String targetForeignQueryKeyName,
java.lang.String sourcePrimaryKeyFieldName)
PUBLIC:
Define the target foreign key relationship in the Variable 1-1 mapping.
|
java.lang.Object |
clone()
INTERNAL:
This methods clones all the fields and ensures that each collection refers to
the same clones.
|
void |
convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL:
Convert all the class-name-based settings in this mapping to actual class-based
settings.
|
java.util.Vector |
getClassIndicatorAssociations()
INTERNAL:
Return the class indicator associations for XML.
|
ClassDescriptor |
getDescriptorForTarget(java.lang.Object targetObject,
AbstractSession session)
INTERNAL:
Return a descriptor for the target of this mapping
For normal ObjectReferenceMappings, we return the reference descriptor.
|
java.lang.Class |
getFieldClassification(DatabaseField fieldToClassify)
INTERNAL:
Return the classification for the field contained in the mapping.
|
java.util.Vector |
getForeignKeyFieldNames()
PUBLIC:
Return the foreign key field names associated with the mapping.
|
java.util.Vector |
getSourceToTargetQueryKeyFieldAssociations()
PUBLIC:
Return a collection of the field to query key associations.
|
java.util.Map |
getSourceToTargetQueryKeyNames()
INTERNAL:
Returns the source keys to target keys fields association.
|
DatabaseField |
getTypeField() |
java.lang.String |
getTypeFieldName()
PUBLIC:
This method returns the name of the typeField of the mapping.
|
java.util.Map |
getTypeIndicatorNameTranslation()
INTERNAL:
Return the typeIndicatorName translation
Used by the Mapping Workbench to avoid classpath dependencies
|
java.util.Map |
getTypeIndicatorTranslation()
INTERNAL:
Return the type indicators.
|
void |
initialize(AbstractSession session)
INTERNAL:
Initialize the mapping.
|
void |
initializeSelectionCriteria(AbstractSession session)
INTERNAL:
Selection criteria is created with source foreign keys and target keys.
|
boolean |
isRelationalMapping()
INTERNAL:
|
boolean |
isVariableOneToOneMapping()
INTERNAL:
|
void |
preInitialize(AbstractSession session)
INTERNAL:
Set the type field classification through searching the indicators hashtable.
|
void |
rehashFieldDependancies(AbstractSession session)
INTERNAL:
Rehash any maps based on fields.
|
void |
setClassIndicatorAssociations(java.util.Vector classIndicatorAssociations)
PUBLIC:
Set the class indicator associations.
|
void |
setForeignKeyFieldNames(java.util.Vector fieldNames)
PUBLIC:
Return the foreign key field names associated with the mapping.
|
void |
setForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetQueryKeyName)
PUBLIC:
A foreign key from the source table and abstract query key from the interface descriptor are added to the
mapping.
|
void |
setSourceToTargetQueryKeyFieldAssociations(java.util.Vector sourceToTargetQueryKeyFieldAssociations)
PUBLIC:
Set a collection of the source to target query key/field associations.
|
void |
setTypeField(DatabaseField typeField)
INTERNAL:
This method set the typeField of the mapping to the parameter field
|
void |
setTypeFieldName(java.lang.String typeFieldName)
PUBLIC:
This method sets the name of the typeField of the mapping.
|
java.lang.Object |
valueFromObject(java.lang.Object object,
DatabaseField field,
AbstractSession session)
INTERNAL:
Get a value from the object and set that in the respective field of the row.
|
java.lang.Object |
valueFromRow(AbstractRecord row,
JoinedAttributeManager joinManager,
ObjectBuildingQuery sourceQuery,
CacheKey cacheKey,
AbstractSession executionSession,
boolean isTargetProtected,
java.lang.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(java.lang.Object object,
AbstractRecord record,
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,
AbstractRecord record,
AbstractSession session)
INTERNAL:
This row is built for shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord,
AbstractRecord record,
AbstractSession session)
INTERNAL:
This row is built for shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForUpdateAfterShallowInsert(java.lang.Object object,
AbstractRecord row,
AbstractSession session,
DatabaseTable table)
INTERNAL:
This row is built for update after shallow insert which happens in case of bidirectional inserts.
|
void |
writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query,
AbstractRecord record)
INTERNAL:
Get a value from the object and set that in the respective field of the row.
|
void |
writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord,
AbstractRecord record,
AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL:
Get a value from the object and set that in the respective field of the row.
|
void |
writeInsertFieldsIntoRow(AbstractRecord record,
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, collectQueryParameters, compareForChange, createCloneValueHolder, earlyPreDelete, extractPrimaryKeyRowForSourceObject, extractPrimaryKeysForReferenceObject, extractPrimaryKeysForReferenceObjectFromRow, extractPrimaryKeysFromRealReferenceObject, fixRealObjectReferences, getForeignKeyFields, getRealAttributeValueFromAttribute, hasConstraintDependency, hasRelationTableMechanism, internalBuildChangeRecord, isChangeTrackingSupported, isForeignKeyRelationship, isObjectReferenceMapping, iterateOnRealAttributeValue, loadAll, mergeChangesIntoObject, mergeIntoObject, postCalculateChanges, postDelete, postInsert, postUpdate, preDelete, preInsert, preUpdate, recordPrivateOwnedRemovals, setIsForeignKeyRelationship, setNewValueInChangeRecord, updateChangeRecord, updateChangeRecordForSelfMerge, useProxyIndirection, useProxyIndirection, useProxyIndirection, valueFromPKList, verifyDelete, writeFromObjectIntoRowForUpdateaddForeignKeyField, addTargetForeignKeyField, buildBackupClone, buildClone, buildCloneFromRow, compareObjects, 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, setSelectionSQLString, setShouldExtendPessimisticLockScope, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldMergeCascadeParts, shouldRefreshCascadeParts, shouldUseBatchReading, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, validateBeforeInitializationaddUnconvertedProperty, 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, isEISMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitialize, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, 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, writeFromAttributeIntoRow, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeUpdateFieldsIntoRowpublic VariableOneToOneMapping()
public boolean isRelationalMapping()
isRelationalMapping in class DatabaseMappingpublic void addClassIndicator(java.lang.Class implementer,
java.lang.Object typeIndicator)
public void addClassNameIndicator(java.lang.String className,
java.lang.Object typeIndicator)
public void addForeignQueryKeyName(DatabaseField sourceForeignKeyField, java.lang.String targetQueryKeyName)
public void addForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetQueryKeyName)
public void addTargetForeignQueryKeyName(java.lang.String targetForeignQueryKeyName,
java.lang.String sourcePrimaryKeyFieldName)
public java.lang.Object clone()
clone in class ForeignReferenceMappingpublic java.util.Vector getClassIndicatorAssociations()
public ClassDescriptor getDescriptorForTarget(java.lang.Object targetObject, AbstractSession session)
getDescriptorForTarget in class ObjectReferenceMappingBug 2612571public java.lang.Class getFieldClassification(DatabaseField fieldToClassify)
getFieldClassification in class DatabaseMappingpublic java.util.Vector getForeignKeyFieldNames()
public java.util.Vector getSourceToTargetQueryKeyFieldAssociations()
public java.util.Map getSourceToTargetQueryKeyNames()
public DatabaseField getTypeField()
public java.lang.String getTypeFieldName()
public java.util.Map getTypeIndicatorTranslation()
public java.util.Map getTypeIndicatorNameTranslation()
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
convertClassNamesToClasses in class ForeignReferenceMappingpublic void initialize(AbstractSession session)
initialize in class ForeignReferenceMappingpublic void initializeSelectionCriteria(AbstractSession session)
public boolean isVariableOneToOneMapping()
isVariableOneToOneMapping in class DatabaseMappingpublic void preInitialize(AbstractSession session) throws DescriptorException
preInitialize in class ObjectReferenceMappingDescriptorExceptionpublic void rehashFieldDependancies(AbstractSession session)
rehashFieldDependancies in class DatabaseMappingpublic void setClassIndicatorAssociations(java.util.Vector classIndicatorAssociations)
public void setForeignKeyFieldNames(java.util.Vector fieldNames)
public void setForeignQueryKeyName(java.lang.String sourceForeignKeyFieldName,
java.lang.String targetQueryKeyName)
public void setSourceToTargetQueryKeyFieldAssociations(java.util.Vector sourceToTargetQueryKeyFieldAssociations)
public void setTypeField(DatabaseField typeField)
public void setTypeFieldName(java.lang.String typeFieldName)
public java.lang.Object valueFromObject(java.lang.Object object,
DatabaseField field,
AbstractSession session)
valueFromObject in class DatabaseMappingpublic java.lang.Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, java.lang.Boolean[] wasCacheUsed) throws DatabaseException
valueFromRow in class ForeignReferenceMappingDatabaseExceptionpublic void writeFromObjectIntoRow(java.lang.Object object,
AbstractRecord record,
AbstractSession session,
DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow in class DatabaseMappingpublic void writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session, DatabaseMapping.WriteType writeType)
writeFromObjectIntoRowWithChangeRecord in class DatabaseMappingpublic void writeFromObjectIntoRowForShallowInsert(java.lang.Object object,
AbstractRecord record,
AbstractSession session)
writeFromObjectIntoRowForShallowInsert in class DatabaseMappingpublic void writeFromObjectIntoRowForUpdateAfterShallowInsert(java.lang.Object object,
AbstractRecord row,
AbstractSession session,
DatabaseTable table)
writeFromObjectIntoRowForUpdateAfterShallowInsert in class DatabaseMappingpublic void writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord record, AbstractSession session)
writeFromObjectIntoRowForShallowInsertWithChangeRecord in class DatabaseMappingpublic void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, AbstractRecord record)
writeFromObjectIntoRowForWhereClause in class ObjectReferenceMappingpublic void writeInsertFieldsIntoRow(AbstractRecord record, AbstractSession session)
writeInsertFieldsIntoRow in class DatabaseMappingEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference