|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.ForeignReferenceMapping
org.eclipse.persistence.mappings.ObjectReferenceMapping
org.eclipse.persistence.mappings.OneToOneMapping
public class OneToOneMapping
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.
Field Summary | |
---|---|
protected boolean |
isDefinedAsManyToOneMapping
266912: Since: EclipseLink 2.0 for the Metamodel API For 1:1 and m:m mappings - track the original externally defined mapping if different Note: This field will provide differentiation for the following external to internal representations for mapping types - A OneToManyMapping will be represented by a ManyToManyMapping if unidirectional - A ManyToOneMapping will be represented by a OneToOneMapping (without a FK constraint) |
org.eclipse.persistence.internal.helper.DatabaseTable |
keyTableForMapKey
|
protected RelationTableMechanism |
mechanism
Mechanism holds relationTable and all fields and queries associated with it. |
protected Expression |
privateOwnedCriteria
|
protected static java.lang.String |
setObject
|
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 java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
sourceToTargetKeyFields
Maps the source foreign/primary key fields to the target primary/foreign key fields. |
protected java.util.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. |
Fields inherited from class org.eclipse.persistence.mappings.ObjectReferenceMapping |
---|
foreignKeyFields, isForeignKeyRelationship |
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping |
---|
cascadeDetach, cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isPrivateOwned, joinFetch, NONE, OUTER_JOIN, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession, usesBatchReading |
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 | |
---|---|
OneToOneMapping()
PUBLIC: Default constructor. |
Method Summary | |
---|---|
void |
addAdditionalFieldsToQuery(ReadQuery selectionQuery,
Expression baseExpression)
INTERNAL: Used when initializing queries for mappings that use a Map Called when the selection query is being initialized to add the fields for the map key to the query |
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.sessions.UnitOfWorkImpl unitOfWork,
boolean isExisting)
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. |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
collectFields()
INTERNAL: Return all the fields populated by this mapping, these are foreign keys only. |
java.lang.Object |
createMapComponentFromJoinedRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession session)
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.sessions.AbstractSession session)
INTERNAL Called when a DatabaseMapping is used to map the key in a collection. |
QueryKey |
createQueryKeyForMapKey()
INTERNAL: Create a query key that links to the map key |
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. |
protected void |
extendPessimisticLockScopeInTargetQuery(ObjectLevelReadQuery targetQuery,
ObjectBuildingQuery sourceQuery)
INTERNAL: Adds locking clause to the target query to extend pessimistic lock scope. |
protected java.util.Vector |
extractForeignKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the foreign key value from the source row. |
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 |
protected java.util.Vector |
extractKeyFromReferenceObject(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the key value from the reference object. |
java.util.Vector |
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). |
java.lang.Object |
extractResultFromBatchQuery(DatabaseQuery query,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
INTERNAL: Extract the value from the batch optimized query. |
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 |
protected ReadQuery |
getExtendPessimisticLockScopeDedicatedQuery(org.eclipse.persistence.internal.sessions.AbstractSession session,
short lockMode)
INTERNAL: Should be overridden by subclass that allows setting extendPessimisticLockScope to DEDICATED_QUERY. |
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. |
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 |
protected java.util.Map |
getForeignKeysToPrimaryKeys()
Return the appropriate hashtable that maps the "foreign keys" to the "primary keys". |
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.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. |
protected ClassDescriptor |
getPrimaryKeyDescriptor()
Return the descriptor for whichever side of the relation has the "primary key". |
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)
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. |
protected void |
initializeForeignKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: The foreign keys primary keys are stored as database fields in the map. |
protected void |
initializeForeignKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: The foreign keys primary keys are stored as database fields in the map. |
protected void |
initializePrivateOwnedCriteria()
INTERNAL: Selection criteria is created with source foreign keys and target keys. |
boolean |
isCascadedLockingSupported()
INTERNAL Return true if this mapping supports cascaded version optimistic locking. |
boolean |
isDefinedAsManyToOneMapping()
INTERNAL: Return whether this mapping was originally defined as a ManyToOne |
boolean |
isJoiningSupported()
INTERNAL: Return if this mapping support joining. |
boolean |
isOneToOneMapping()
INTERNAL: |
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 |
postInitializeMapValueSelectionQuery(ReadQuery selectionQuery,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow the selectionQuery to be modified when this MapComponentMapping is used as the value in a Map |
void |
postInsert(WriteObjectQuery query)
INTERNAL: Insert into relation table. |
protected void |
postPrepareNestedBatchQuery(ReadQuery batchQuery,
ReadAllQuery query)
INTERNAL: Allow the mapping the do any further batch preparation. |
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. |
protected java.lang.Object |
readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery)
INTERNAL: Reads the private owned object. |
void |
rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Rehash any map based on fields. |
void |
setDefinedAsManyToOneMapping(boolean isDefinedAsManyToOneMapping)
INTERNAL: Set whether this mapping was originally defined as a ManyToOne |
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. |
protected void |
setPrivateOwnedCriteria(Expression expression)
INTERNAL: Private owned criteria is used to verify the deletion of the target. |
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. |
protected java.lang.Object |
valueFromRowInternal(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 java.lang.Object |
valueFromRowInternalWithJoin(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. |
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)
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 |
writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session)
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. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.persistence.mappings.foundation.MapKeyMapping |
---|
cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, getReferenceDescriptor |
Field Detail |
---|
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> sourceToTargetKeyFields
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetToSourceKeyFields
protected boolean shouldVerifyDelete
protected transient Expression privateOwnedCriteria
public org.eclipse.persistence.internal.helper.DatabaseTable keyTableForMapKey
protected static final java.lang.String setObject
protected transient RelationTableMechanism mechanism
protected boolean isDefinedAsManyToOneMapping
Constructor Detail |
---|
public OneToOneMapping()
Method Detail |
---|
public boolean isRelationalMapping()
isRelationalMapping
in class DatabaseMapping
public void addAdditionalFieldsToQuery(ReadQuery selectionQuery, Expression baseExpression)
addAdditionalFieldsToQuery
in interface MapKeyMapping
public 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)
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)
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
object
- manager
- public java.lang.Object buildElementClone(java.lang.Object attributeValue, java.lang.Object parent, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)
buildElementClone
in interface MapKeyMapping
element
- unitOfWork
- isExisting
-
public Expression buildObjectJoinExpression(Expression expression, java.lang.Object value, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildObjectJoinExpression
in class DatabaseMapping
public Expression buildObjectJoinExpression(Expression expression, Expression argument, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildObjectJoinExpression
in class DatabaseMapping
public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
buildSelectionQueryForDirectCollectionKeyMapping
in interface MapKeyMapping
public java.lang.Object clone()
clone
in class ForeignReferenceMapping
public java.lang.Object createMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
createMapComponentFromRow
in interface MapComponentMapping
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.sessions.AbstractSession session)
createMapComponentFromJoinedRow
in interface MapKeyMapping
public QueryKey createQueryKeyForMapKey()
createQueryKeyForMapKey
in interface MapKeyMapping
public void deleteMapKey(java.lang.Object objectDeleted, org.eclipse.persistence.internal.sessions.AbstractSession session)
deleteMapKey
in interface MapKeyMapping
objectDeleted
- session
- protected void extendPessimisticLockScopeInTargetQuery(ObjectLevelReadQuery targetQuery, ObjectBuildingQuery sourceQuery)
extendPessimisticLockScopeInTargetQuery
in class ForeignReferenceMapping
public void extendPessimisticLockScopeInSourceQuery(ObjectLevelReadQuery sourceQuery)
extendPessimisticLockScopeInSourceQuery
in class ForeignReferenceMapping
protected java.util.Vector extractForeignKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
public java.util.Map extractIdentityFieldsForQuery(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
extractIdentityFieldsForQuery
in interface MapKeyMapping
protected java.util.Vector extractKeyFromReferenceObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
public java.util.Vector extractPrimaryKeysForReferenceObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row)
extractPrimaryKeysForReferenceObjectFromRow
in class ObjectReferenceMapping
protected void postPrepareNestedBatchQuery(ReadQuery batchQuery, ReadAllQuery query)
postPrepareNestedBatchQuery
in class ForeignReferenceMapping
public java.lang.Object extractResultFromBatchQuery(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
extractResultFromBatchQuery
in class ForeignReferenceMapping
public Expression getAdditionalSelectionCriteriaForMapKey()
getAdditionalSelectionCriteriaForMapKey
in interface MapKeyMapping
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseTable> getAdditionalTablesForJoinQuery()
getAdditionalTablesForJoinQuery
in interface MapKeyMapping
protected ReadQuery getExtendPessimisticLockScopeDedicatedQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, short lockMode)
getExtendPessimisticLockScopeDedicatedQuery
in class ForeignReferenceMapping
public java.lang.Class getFieldClassification(org.eclipse.persistence.internal.helper.DatabaseField fieldToClassify) throws DescriptorException
getFieldClassification
in class DatabaseMapping
DescriptorException
public java.util.Vector getForeignKeyFieldNames()
protected java.util.Map getForeignKeysToPrimaryKeys()
public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getForeignKeyFieldsForMapKey()
getForeignKeyFieldsForMapKey
in interface MapKeyMapping
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getIdentityFieldsForMapKey()
getIdentityFieldsForMapKey
in interface MapKeyMapping
public ObjectLevelReadQuery getNestedJoinQuery(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectLevelReadQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
getNestedJoinQuery
in interface MapKeyMapping
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getAllFieldsForMapKey()
getAllFieldsForMapKey
in interface MapKeyMapping
public java.util.Vector getOrderedForeignKeyFields()
protected ClassDescriptor getPrimaryKeyDescriptor()
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)
getTargetVersionOfSourceObject
in interface MapKeyMapping
public java.lang.Class getMapKeyTargetType()
getMapKeyTargetType
in interface MapKeyMapping
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in class ForeignReferenceMapping
DescriptorException
protected void initializeForeignKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void initializeForeignKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void initializePrivateOwnedCriteria()
public void preinitializeMapKey(org.eclipse.persistence.internal.helper.DatabaseTable table) throws DescriptorException
preinitializeMapKey
in interface MapKeyMapping
DescriptorException
public void postInitializeMapValueSelectionQuery(ReadQuery selectionQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)
public void prepareCascadeLockingPolicy()
prepareCascadeLockingPolicy
in class DatabaseMapping
public Expression buildSelectionCriteria()
public Expression buildSelectionCriteria(boolean useParameter, boolean usePreviousSelectionCriteria)
useParameter
- 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 DatabaseMapping
public boolean isOneToOneMapping()
isOneToOneMapping
in class DatabaseMapping
public boolean isOwned()
isOwned
in class DatabaseMapping
protected java.lang.Object readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery) throws DatabaseException
readPrivateOwnedForObject
in class ObjectReferenceMapping
DatabaseException
public void rehashFieldDependancies(org.eclipse.persistence.internal.sessions.AbstractSession session)
rehashFieldDependancies
in class DatabaseMapping
public void setDefinedAsManyToOneMapping(boolean isDefinedAsManyToOneMapping)
isDefinedAsManyToOneMapping
- public void setForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName)
public void setForeignKeyFieldNames(java.util.Vector fieldNames)
protected void setPrivateOwnedCriteria(Expression expression)
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 DatabaseMapping
public boolean isDefinedAsManyToOneMapping()
public boolean isJoiningSupported()
isJoiningSupported
in class ForeignReferenceMapping
public void iterateOnMapKey(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)
iterateOnMapKey
in interface MapKeyMapping
iterator
- element
- public java.lang.Object unwrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
unwrapKey
in interface MapKeyMapping
key
- session
-
public java.lang.Object wrapKey(java.lang.Object key, org.eclipse.persistence.internal.sessions.AbstractSession session)
wrapKey
in interface MapKeyMapping
key
- session
-
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
protected java.lang.Object valueFromRowInternalWithJoin(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
valueFromRowInternalWithJoin
in class ForeignReferenceMapping
DatabaseException
protected java.lang.Object valueFromRowInternal(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
valueFromRowInternal
in class ForeignReferenceMapping
DatabaseException
public void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
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 writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session)
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 DatabaseMapping
public boolean hasRelationTableMechanism()
public boolean hasRelationTable()
public RelationTableMechanism getRelationTableMechanism()
public void setRelationTableMechanism(RelationTableMechanism mechanism)
public org.eclipse.persistence.internal.helper.DatabaseTable getRelationTable()
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete
in class ObjectReferenceMapping
DatabaseException
OptimisticLockException
public 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 ObjectReferenceMapping
DatabaseException
public void postUpdate(WriteObjectQuery query) throws DatabaseException
postUpdate
in class ObjectReferenceMapping
DatabaseException
public void performDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException, DescriptorException
performDataModificationEvent
in class DatabaseMapping
DatabaseException
DescriptorException
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> collectFields()
collectFields
in class ObjectReferenceMapping
|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |