EclipseLink 2.1.2, build 'v20101206-r8635' API Reference

org.eclipse.persistence.mappings
Class VariableOneToOneMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.ForeignReferenceMapping
          extended by org.eclipse.persistence.mappings.ObjectReferenceMapping
              extended by org.eclipse.persistence.mappings.VariableOneToOneMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, RelationalMapping

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.

See Also:
Serialized Form
Author:
Sati
Since:
TOPLink/Java 2.0

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
 
Field Summary
protected  java.util.Map sourceToTargetQueryKeyNames
           
protected  org.eclipse.persistence.internal.helper.DatabaseField typeField
           
protected  java.util.Map typeIndicatorNameTranslation
          parallel table typeIndicatorTranslation used prior to initialization to avoid type indicators on Mapping Workbench
protected  java.util.Map typeIndicatorTranslation
           
 
Fields inherited from class org.eclipse.persistence.mappings.ObjectReferenceMapping
foreignKeyFields, isForeignKeyRelationship
 
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchFetchType, cascadeDetach, cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isPrivateOwned, joinFetch, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_1
 
Constructor Summary
VariableOneToOneMapping()
          PUBLIC: Default constructor.
 
Method Summary
 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(org.eclipse.persistence.internal.helper.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.
protected  java.lang.Object batchedValueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, ObjectLevelReadQuery query)
          INTERNAL: Possible for future development, not currently supported.
 java.lang.Object clone()
          INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones.
protected  java.util.Vector collectFields()
          INTERNAL: Return all the fields populated by this mapping.
protected  boolean compareObjectsWithoutPrivateOwned(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Compare the references of the two objects are the same, not the objects themselves.
 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, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Return a descriptor for the target of this mapping For normal ObjectReferenceMappings, we return the reference descriptor.
 java.lang.Class getFieldClassification(org.eclipse.persistence.internal.helper.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.
protected  java.lang.Object getImplementorForType(java.lang.Object type, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Return the implementor for a specified type
protected  java.lang.Object getPrimaryKeyForObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL:
 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.
 org.eclipse.persistence.internal.helper.DatabaseField getTypeField()
           
 java.lang.String getTypeFieldName()
          PUBLIC: This method returns the name of the typeField of the mapping.
protected  java.lang.Object getTypeForImplementor(java.lang.Class implementor)
          INTERNAL: Return the type for a specified implementor
 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(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize the mapping.
protected  void initializeForeignKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: The foreign key names and their primary keys are converted to DatabaseField and stored.
 void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Selection criteria is created with source foreign keys and target keys.
 boolean isRelationalMapping()
          INTERNAL:
 boolean isVariableOneToOneMapping()
          INTERNAL:
 void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Set the type field classification through searching the indicators hashtable.
 void rehashFieldDependancies(org.eclipse.persistence.internal.sessions.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.
protected  void setSourceToTargetQueryKeyFields(java.util.Map sourceToTargetQueryKeyNames)
          INTERNAL: Set the source keys to target keys fields association.
 void setTypeField(org.eclipse.persistence.internal.helper.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.
protected  void setTypeIndicatorNameTranslation(java.util.Map translations)
          INTERNAL: For avoiding classpath dependencies on the Mapping Workbench
protected  void setTypeIndicatorTranslation(java.util.Map translations)
          INTERNAL: Set the typeIndicatorTranslations hashtable to the new Hashtable translations
 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 valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
          INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.
protected  void writeFromNullObjectIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record)
          INTERNAL: Get a value from the object and set that in the respective field of the row.
 void writeFromObjectIntoRow(java.lang.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.
 void writeFromObjectIntoRowForShallowInsert(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord record, 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 record, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
 void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord record)
          INTERNAL: Get a value from the object and set that in the respective field of the row.
 void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, 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.
 void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Write fields needed for insert into the template for with null values.
 
Methods inherited from class org.eclipse.persistence.mappings.ObjectReferenceMapping
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildExpression, buildReferencesPKList, buildTargetInterfaces, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, cascadeRegisterNewIfRequired, compareForChange, compareObjectsWithPrivateOwned, createUnitOfWorkValueHolder, extractPrimaryKeyRowForSourceObject, extractPrimaryKeysForReferenceObject, extractPrimaryKeysForReferenceObjectFromRow, extractPrimaryKeysFromRealReferenceObject, fixRealObjectReferences, getForeignKeyFields, getRealAttributeValueFromAttribute, hasConstraintDependency, insert, internalBuildChangeRecord, isChangeTrackingSupported, isForeignKeyRelationship, isObjectReferenceMapping, iterateOnRealAttributeValue, mergeChangesIntoObject, mergeIntoObject, postCalculateChanges, postDelete, postInsert, postUpdate, preDelete, preInsert, preUpdate, readPrivateOwnedForObject, recordPrivateOwnedRemovals, setForeignKeyFields, setIsForeignKeyRelationship, setNewValueInChangeRecord, update, updateChangeRecord, useProxyIndirection, useProxyIndirection, useProxyIndirection, valueFromPKList, verifyDelete, writeFromObjectIntoRowForUpdate
 
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
buildBackupClone, buildBatchCriteria, buildClone, buildCloneFromRow, checkCacheForBatchKey, compareObjects, dontDoMerge, dontUseBatchReading, dontUseIndirection, executeBatchQuery, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, extractBatchKeyFromRow, extractResultFromBatchQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getExtendPessimisticLockScopeDedicatedQuery, getIndirectionPolicy, getJoinCriteria, getJoinFetch, getObjectCorrespondingTo, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, initializeReferenceDescriptor, initializeSelectionQuery, instantiateAttribute, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isJoiningSupported, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, postPrepareNestedBatchQuery, prepareHistoricalQuery, prepareNestedBatchQuery, prepareNestedJoinQueryClone, prepareNestedJoins, privateOwnedRelationship, remoteInitialization, replaceValueHoldersIn, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionQuery, setSelectionSQLString, setShouldExtendPessimisticLockScope, setTempSession, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldObjectModifyCascadeToParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, validateBeforeInitialization, valueFromRowInternal, valueFromRowInternalWithJoin
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeMerge, cloneFields, derivesId, earlyPreDelete, extractNestedExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getWeight, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isNestedTableMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitialize, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeUpdateFieldsIntoRow
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

typeField

protected org.eclipse.persistence.internal.helper.DatabaseField typeField

sourceToTargetQueryKeyNames

protected java.util.Map sourceToTargetQueryKeyNames

typeIndicatorTranslation

protected java.util.Map typeIndicatorTranslation

typeIndicatorNameTranslation

protected java.util.Map typeIndicatorNameTranslation
parallel table typeIndicatorTranslation used prior to initialization to avoid type indicators on Mapping Workbench

Constructor Detail

VariableOneToOneMapping

public VariableOneToOneMapping()
PUBLIC: Default constructor.

Method Detail

isRelationalMapping

public boolean isRelationalMapping()
INTERNAL:

Overrides:
isRelationalMapping in class DatabaseMapping

addClassIndicator

public void addClassIndicator(java.lang.Class implementer,
                              java.lang.Object typeIndicator)
PUBLIC: Add a type indicator conversion to this mapping.


addClassNameIndicator

public void addClassNameIndicator(java.lang.String className,
                                  java.lang.Object typeIndicator)
INTERNAL: Add indicators by classname. For use by the Mapping Workbench to avoid classpath dependencies


addForeignQueryKeyName

public void addForeignQueryKeyName(org.eclipse.persistence.internal.helper.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. This method is used if there are multiple foreign keys.


addForeignQueryKeyName

public 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. This method is used if there are multiple foreign keys.


addTargetForeignQueryKeyName

public void addTargetForeignQueryKeyName(java.lang.String targetForeignQueryKeyName,
                                         java.lang.String sourcePrimaryKeyFieldName)
PUBLIC: Define the target foreign key relationship in the Variable 1-1 mapping. This method is used for composite target foreign key relationships, that is the target object's table has multiple foreign key fields to the source object's primary key fields. Both the target foreign key query name and the source primary key field name must be specified. The distinction between a foreign key and target foreign key is that the variable 1-1 mapping will not populate the target foreign key value when written (because it is in the target table). Normally 1-1's are through foreign keys but in bi-directional 1-1's the back reference will be a target foreign key. In obscure composite legacy data models a 1-1 may consist of a foreign key part and a target foreign key part, in this case both method will be called with the correct parts.


batchedValueFromRow

protected java.lang.Object batchedValueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                               ObjectLevelReadQuery query)
INTERNAL: Possible for future development, not currently supported. Retrieve the value through using batch reading. This executes a single query to read the target for all of the objects and stores the result of the batch query in the original query to allow the other objects to share the results.

Overrides:
batchedValueFromRow in class ForeignReferenceMapping

clone

public java.lang.Object clone()
INTERNAL: This methods clones all the fields and ensures that each collection refers to the same clones.

Overrides:
clone in class ForeignReferenceMapping

collectFields

protected java.util.Vector collectFields()
INTERNAL: Return all the fields populated by this mapping.

Overrides:
collectFields in class ObjectReferenceMapping

compareObjectsWithoutPrivateOwned

protected boolean compareObjectsWithoutPrivateOwned(java.lang.Object firstObject,
                                                    java.lang.Object secondObject,
                                                    org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the references of the two objects are the same, not the objects themselves. Used for independent relationships. This is used for testing and validation purposes. Must get separate fields for the objects because we may be adding a different class to the attribute because of the interface

Overrides:
compareObjectsWithoutPrivateOwned in class ObjectReferenceMapping

getClassIndicatorAssociations

public java.util.Vector getClassIndicatorAssociations()
INTERNAL: Return the class indicator associations for XML. List of class-name/value associations.


getDescriptorForTarget

public ClassDescriptor getDescriptorForTarget(java.lang.Object targetObject,
                                              org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return a descriptor for the target of this mapping For normal ObjectReferenceMappings, we return the reference descriptor. For a VariableOneToOneMapping, the reference descriptor is often a descriptor for an interface and does not contain adequate information. As a result, we look up the descriptor for the specific class we are looking for Bug 2612571

Overrides:
getDescriptorForTarget in class ObjectReferenceMapping
See Also:
Bug 2612571

getFieldClassification

public java.lang.Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify)
INTERNAL: Return the classification for the field contained in the mapping. This is used to convert the row value to a consistent java value.

Overrides:
getFieldClassification in class DatabaseMapping

getForeignKeyFieldNames

public java.util.Vector getForeignKeyFieldNames()
PUBLIC: Return the foreign key field names associated with the mapping. These are only the source fields that are writable.


getImplementorForType

protected java.lang.Object getImplementorForType(java.lang.Object type,
                                                 org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return the implementor for a specified type


getSourceToTargetQueryKeyFieldAssociations

public java.util.Vector getSourceToTargetQueryKeyFieldAssociations()
PUBLIC: Return a collection of the field to query key associations.


getSourceToTargetQueryKeyNames

public java.util.Map getSourceToTargetQueryKeyNames()
INTERNAL: Returns the source keys to target keys fields association.


getTypeField

public org.eclipse.persistence.internal.helper.DatabaseField getTypeField()

getTypeFieldName

public java.lang.String getTypeFieldName()
PUBLIC: This method returns the name of the typeField of the mapping. The type field is used to store the type of object the relationship is referencing.


getTypeForImplementor

protected java.lang.Object getTypeForImplementor(java.lang.Class implementor)
INTERNAL: Return the type for a specified implementor


getTypeIndicatorTranslation

public java.util.Map getTypeIndicatorTranslation()
INTERNAL: Return the type indicators.


getTypeIndicatorNameTranslation

public java.util.Map getTypeIndicatorNameTranslation()
INTERNAL: Return the typeIndicatorName translation Used by the Mapping Workbench to avoid classpath dependencies


convertClassNamesToClasses

public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.

Overrides:
convertClassNamesToClasses in class ForeignReferenceMapping

initialize

public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize the mapping.

Overrides:
initialize in class ForeignReferenceMapping

initializeForeignKeys

protected void initializeForeignKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: The foreign key names and their primary keys are converted to DatabaseField and stored.


initializeSelectionCriteria

public void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Selection criteria is created with source foreign keys and target keys. This criteria is then used to read target records from the table.


isVariableOneToOneMapping

public boolean isVariableOneToOneMapping()
INTERNAL:

Overrides:
isVariableOneToOneMapping in class DatabaseMapping

getPrimaryKeyForObject

protected java.lang.Object getPrimaryKeyForObject(java.lang.Object object,
                                                  org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:

Overrides:
getPrimaryKeyForObject in class ObjectReferenceMapping

preInitialize

public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                   throws DescriptorException
INTERNAL: Set the type field classification through searching the indicators hashtable.

Overrides:
preInitialize in class ObjectReferenceMapping
Throws:
DescriptorException

rehashFieldDependancies

public void rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Rehash any maps based on fields. This is used to clone descriptors for aggregates, which hammer field names.

Overrides:
rehashFieldDependancies in class DatabaseMapping

setClassIndicatorAssociations

public void setClassIndicatorAssociations(java.util.Vector classIndicatorAssociations)
PUBLIC: Set the class indicator associations.


setForeignKeyFieldNames

public void setForeignKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Return the foreign key field names associated with the mapping. These are only the source fields that are writable.


setForeignQueryKeyName

public 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. This method is used if foreign key is not composite.


setSourceToTargetQueryKeyFieldAssociations

public void setSourceToTargetQueryKeyFieldAssociations(java.util.Vector sourceToTargetQueryKeyFieldAssociations)
PUBLIC: Set a collection of the source to target query key/field associations.


setSourceToTargetQueryKeyFields

protected void setSourceToTargetQueryKeyFields(java.util.Map sourceToTargetQueryKeyNames)
INTERNAL: Set the source keys to target keys fields association.


setTypeField

public void setTypeField(org.eclipse.persistence.internal.helper.DatabaseField typeField)
INTERNAL: This method set the typeField of the mapping to the parameter field


setTypeFieldName

public void setTypeFieldName(java.lang.String typeFieldName)
PUBLIC: This method sets the name of the typeField of the mapping. The type field is used to store the type of object the relationship is referencing.


setTypeIndicatorTranslation

protected void setTypeIndicatorTranslation(java.util.Map translations)
INTERNAL: Set the typeIndicatorTranslations hashtable to the new Hashtable translations


setTypeIndicatorNameTranslation

protected void setTypeIndicatorNameTranslation(java.util.Map translations)
INTERNAL: For avoiding classpath dependencies on the Mapping Workbench


valueFromObject

public 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.

Overrides:
valueFromObject in class DatabaseMapping

valueFromRow

public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                     org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
                                     ObjectBuildingQuery sourceQuery,
                                     org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
                              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 class ForeignReferenceMapping
Throws:
DatabaseException

writeFromNullObjectIntoRow

protected void writeFromNullObjectIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record)
INTERNAL: Get a value from the object and set that in the respective field of the row.


writeFromObjectIntoRow

public void writeFromObjectIntoRow(java.lang.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. If the mapping id target foreign key, you must only write the type into the roe, the rest will be updated when the object itself is written

Overrides:
writeFromObjectIntoRow in class DatabaseMapping

writeFromObjectIntoRowWithChangeRecord

public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
                                                   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. If the mapping id target foreign key, you must only write the type into the roe, the rest will be updated when the object itself is written

Overrides:
writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping

writeFromObjectIntoRowForShallowInsert

public void writeFromObjectIntoRowForShallowInsert(java.lang.Object object,
                                                   org.eclipse.persistence.internal.sessions.AbstractRecord record,
                                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. The foreign keys must be set to null to avoid constraints.

Overrides:
writeFromObjectIntoRowForShallowInsert in class DatabaseMapping

writeFromObjectIntoRowForShallowInsertWithChangeRecord

public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
                                                                   org.eclipse.persistence.internal.sessions.AbstractRecord record,
                                                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. The foreign keys must be set to null to avoid constraints.

Overrides:
writeFromObjectIntoRowForShallowInsertWithChangeRecord in class DatabaseMapping

writeFromObjectIntoRowForWhereClause

public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query,
                                                 org.eclipse.persistence.internal.sessions.AbstractRecord record)
INTERNAL: Get a value from the object and set that in the respective field of the row.

Overrides:
writeFromObjectIntoRowForWhereClause in class ObjectReferenceMapping

writeInsertFieldsIntoRow

public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record,
                                     org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for insert into the template for with null values.

Overrides:
writeInsertFieldsIntoRow in class DatabaseMapping

EclipseLink 2.1.2, build 'v20101206-r8635' API Reference