Module org.eclipse.persistence.jpa
Class RelationshipAccessor
java.lang.Object
org.eclipse.persistence.internal.jpa.metadata.ORMetadata
org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor
- Direct Known Subclasses:
CollectionAccessor,ObjectAccessor
INTERNAL:
A relational accessor.
Key notes:
- any metadata mapped from XML to this class must be compared in the
equals method.
- any metadata mapped from XML to this class must be handled in the merge
method. (merging is done at the accessor/mapping level)
- any metadata mapped from XML to this class must be initialized in the
initXMLObject method.
- methods should be preserved in alphabetical order.
- Since:
- TopLink EJB 3.0 Reference Implementation
-
Field Summary
FieldsFields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
KEY_DOT_NOTATION, m_field, VALUE_DOT_NOTATIONFields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRelationshipAccessor(String xmlElement) INTERNAL:protectedRelationshipAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddJoinTableRelationKeyFields(List<JoinColumnMetadata> joinColumns, RelationTableMechanism mechanism, String defaultFieldName, MetadataDescriptor descriptor, boolean isSource) INTERNAL: Add the relation key fields to a many to many mapping.booleanINTERNAL:INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.abstract StringINTERNAL:protected DatabaseTableINTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKeygetFetch()INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.protected JoinTableMetadataINTERNAL: This method will return the join table metadata to be processed with this relationship accessor.protected abstract StringINTERNAL: Return the logging context for this accessor.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.protected DatabaseMappingINTERNAL: Method to return an owner mapping.INTERNAL: Used for OX mapping.INTERNAL: Return the reference metadata descriptor for this accessor.INTERNAL: Return the target entity for this accessor.INTERNAL: Used for OX mapping.inthashCode()protected booleanINTERNAL: Return true if a join table exists for this accessor (either directly set or through an association override).booleanINTERNAL: Return true if this accessor is the non owning side of the relationship, that is, has a mapped by value.voidinitXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:booleanINTERNAL:booleanisLazy()INTERNAL: Return if the accessor should be lazy fetched.booleanINTERNAL: Used for OX mapping.protected booleanINTERNAL: Return true is this relationship employs orphanRemoval.booleanINTERNAL: Used for OX mapping.booleanINTERNAL: If somehow we are processing a class that was weaved to have value holders, we should ignore the processing of this mapping.voidprocess()INTERNAL: Common validation done by all relationship accessors.protected voidprocessBatchFetch(ForeignReferenceMapping mapping) INTERNAL: Set the batch fetch type on the foreign reference mapping.protected voidINTERNAL:protected voidprocessJoinTable(ForeignReferenceMapping mapping, RelationTableMechanism mechanism, JoinTableMetadata joinTable) INTERNAL: Process a MetadataJoinTable.protected voidprocessMappedByRelationTable(RelationTableMechanism ownerMechanism, RelationTableMechanism mechanism) INTERNAL:protected voidINTERNAL: This method should be called for all mappings even though they may not support.protected voidINTERNAL: Process settings common to ForeignReferenceMapping.protected voidsetAccessorMethods(DatabaseMapping mapping) INTERNAL: Set the getter and setter access methods for this accessor.voidsetBatchFetch(BatchFetchMetadata batchFetch) INTERNAL: Used for OX mapping.voidsetCascade(CascadeMetadata cascade) INTERNAL: Used for OX mapping.voidsetCascadeOnDelete(Boolean cascadeOnDelete) INTERNAL: Used for OX mapping.voidINTERNAL: Used for OX mapping.voidsetForeignKey(ForeignKeyMetadata foreignKey) INTERNAL: Used for OX mapping.voidsetJoinColumns(List<JoinColumnMetadata> joinColumns) INTERNAL: Used for OX mapping.voidsetJoinFetch(String joinFetch) INTERNAL: Used for OX mapping.voidsetJoinFields(List<JoinFieldMetadata> joinFields) INTERNAL: Used for OX mapping.voidsetJoinTable(JoinTableMetadata joinTable) INTERNAL: Used for OX mapping.voidsetMappedBy(String mappedBy) INTERNAL: Used for OX mapping.voidsetNonCacheable(Boolean noncacheable) INTERNAL: Used for OX mapping.voidsetOrphanRemoval(Boolean orphanRemoval) INTERNAL: Used for OX mapping.voidsetPrivateOwned(Boolean privateOwned) INTERNAL: Used for OX mapping.voidsetTargetEntity(MetadataClass targetEntity) INTERNAL:voidsetTargetEntityName(String targetEntityName) INTERNAL: Used for OX mapping.protected booleanINTERNAL:Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
addConvert, addConvertMetadata, addFieldNameTranslation, addMapKeyConvert, derivesId, getAnnotation, getAssociationOverrides, getAttributeName, getAttributeOverride, getAttributeOverrides, getAttributeType, getClassAccessor, getColumn, getConverts, getDatabaseField, getEnumerated, getField, getForeignKey, getGetMethodName, getJoinColumns, getJoinColumnsAndValidate, getLob, getMapKey, getMapKeyConverts, getMapKeyReferenceClass, getMapKeyReferenceClassName, getMapKeyReferenceClassWithGenerics, getMapping, getOwningDescriptor, getOwningDescriptors, getRawClass, getRawClassWithGenerics, getReferenceAccessors, getReferenceClass, getReferenceClassFromGeneric, getReferenceClassName, getReferenceClassWithGenerics, getReferenceDatabaseTable, getSetMethodName, getTemporal, hasAttributeOverride, hasAttributeType, hasEnumerated, hasLob, hasMapKey, hasReturnInsert, hasReturnUpdate, hasTemporal, initXMLMappingAccessor, isAnnotationPresent, isBasic, isBasicCollection, isBasicMap, isCollectionAccessor, isDerivedIdClass, isDirectCollection, isDirectEmbeddableCollection, isEmbedded, isEmbeddedId, isEnumerated, isId, isJson, isLob, isManyToMany, isManyToOne, isMapAccessor, isMappedKeyMapAccessor, isMultitenantId, isOneToMany, isOneToOne, isPrimitiveWrapperClass, isProcessed, isRelationship, isSerialized, isTemporal, isTimeClass, isTransient, isUUID, isValidJsonType, isValidSerializedType, isVariableOneToOne, processAssociationOverride, processAssociationOverrides, processAttributeOverrides, processContainerPolicyAndIndirection, processConvert, processConverts, processDirectMapKeyClass, processEmbeddableMapKeyClass, processEntityMapKeyClass, processEnumerated, processForeignKeyRelationship, processIndirection, processJoinFetch, processJson, processLob, processMapKeyClass, processMappingConverter, processMappingKeyConverter, processMappingValueConverter, processProperties, processProperty, processReturnInsert, processReturnInsertAndUpdate, processReturnUpdate, processSerialized, processSerialized, processTemporal, processUUID, setAttributeType, setClassAccessor, setField, setIndirectionPolicy, setMapping, setOverrideMapping, setTemporal, toString, updatePrimaryKeyField, usesFieldAccess, usesPropertyAccess, usesVirtualAccessMethods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor
getAccess, getAccessibleObject, getAccessMethods, getAnnotatedElement, getAnnotatedElementName, getAnnotation, getConverters, getDefaultAttributeName, getDescriptor, getDescriptorJavaClass, getHashPartitioning, getIdentifier, getJavaClass, getJavaClassName, getName, getObjectTypeConverters, getPartitioned, getPartitioning, getPinnedPartitioning, getProperties, getRangePartitioning, getReferencedField, getReferencedField, getReplicationPartitioning, getRoundRobinPartitioning, getSerializedConverters, getStructConverters, getTypeConverters, getUnionPartitioning, getUpperCaseShortJavaClassName, getValue, getValue, getValuePartitioning, hasAccess, hasAccessMethods, initAccess, initXMLAccessor, isAnnotationPresent, merge, processConverters, processCustomConverters, processObjectTypeConverters, processPartitioned, processPartitioning, processPrimaryKeyJoinColumns, processSerializedConverters, processStructConverters, processTable, processTypeConverters, setAccess, setAccessMethods, setConverters, setDescriptor, setHashPartitioning, setName, setObjectTypeConverters, setPartitioned, setPartitioning, setPinnedPartitioning, setProperties, setRangePartitioning, setReplicationPartitioning, setRoundRobinPartitioning, setSerializedConverters, setStructConverters, setTypeConverters, setUnionPartitioning, setValuePartitioningMethods inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
getAccessibleObjectName, getAnnotation, getBoxedType, getDatabaseTypeEnum, getEntityMappings, getFullyQualifiedClassName, getJavaClass, getJavaClassName, getLoader, getLocation, getLogger, getMetadataClass, getMetadataClass, getMetadataClass, getMetadataFactory, getName, getPrimitiveClassForName, getProject, getText, getXMLElement, hasIdentifier, hasText, initXMLClassName, initXMLObject, initXMLObjects, initXMLTextObject, loadedFromAnnotation, loadedFromEclipseLinkXML, loadedFromXML, mergeORObjectLists, mergeORObjects, mergeSimpleObjects, reloadEntity, reloadMappedSuperclass, setAccessibleObject, setEntityMappings, setFieldName, setFieldName, setProject, shouldOverride, valuesMatch, valuesMatch
-
Field Details
-
m_referenceClass
-
-
Constructor Details
-
RelationshipAccessor
INTERNAL: -
RelationshipAccessor
protected RelationshipAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL:
-
-
Method Details
-
addJoinTableRelationKeyFields
protected void addJoinTableRelationKeyFields(List<JoinColumnMetadata> joinColumns, RelationTableMechanism mechanism, String defaultFieldName, MetadataDescriptor descriptor, boolean isSource) INTERNAL: Add the relation key fields to a many to many mapping. -
equals
INTERNAL:- Overrides:
equalsin classMappingAccessor
-
hashCode
public int hashCode()- Overrides:
hashCodein classMappingAccessor
-
getBatchFetch
INTERNAL: Used for OX mapping. -
getCascadeOnDelete
INTERNAL: Used for OX mapping. -
getCascade
INTERNAL: Used for OX mapping. -
getDefaultFetchType
INTERNAL:- Overrides:
getDefaultFetchTypein classMappingAccessor
-
getDefaultTableForEntityMapKey
INTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKey- Overrides:
getDefaultTableForEntityMapKeyin classMappingAccessor
-
getFetch
INTERNAL: Used for OX mapping. -
getForeignKey
INTERNAL: Used for OX mapping. -
getJoinColumns
INTERNAL: Used for OX mapping. -
getJoinFields
INTERNAL: Used for OX mapping. -
getJoinFetch
INTERNAL: Used for OX mapping. -
getJoinTable
INTERNAL: Used for OX mapping. -
getJoinTableMetadata
INTERNAL: This method will return the join table metadata to be processed with this relationship accessor. It will first check for a join table from an association override, followed by a join table defined directly on the accessor. If neither is present, a join table metadata is defaulted. -
getLoggingContext
INTERNAL: Return the logging context for this accessor. -
getMappedBy
INTERNAL: Used for OX mapping. -
getNonCacheable
INTERNAL: Used for OX mapping. -
getOrphanRemoval
INTERNAL: Used for OX mapping. -
getOwningMapping
INTERNAL: Method to return an owner mapping. It will tell the owner class to process itself if it hasn't already done so. Assumes that a mapped by value has been specified and that a check against mappedBy has been done. -
getPrivateOwned
INTERNAL: Used for OX mapping. -
getReferenceDescriptor
INTERNAL: Return the reference metadata descriptor for this accessor. This method does additional checks to make sure that the target entity is indeed an entity class.- Overrides:
getReferenceDescriptorin classMappingAccessor
-
getTargetEntity
INTERNAL: Return the target entity for this accessor. -
getTargetEntityName
INTERNAL: Used for OX mapping. -
hasJoinTable
protected boolean hasJoinTable()INTERNAL: Return true if a join table exists for this accessor (either directly set or through an association override). -
hasMappedBy
public boolean hasMappedBy()INTERNAL: Return true if this accessor is the non owning side of the relationship, that is, has a mapped by value. -
initXMLObject
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:- Overrides:
initXMLObjectin classMappingAccessor
-
isCascadeOnDelete
public boolean isCascadeOnDelete()INTERNAL: -
isLazy
public boolean isLazy()INTERNAL: Return if the accessor should be lazy fetched. -
isNonCacheable
public boolean isNonCacheable()INTERNAL: Used for OX mapping. -
isOrphanRemoval
protected boolean isOrphanRemoval()INTERNAL: Return true is this relationship employs orphanRemoval. -
isPrivateOwned
public boolean isPrivateOwned()INTERNAL: Used for OX mapping. -
isValueHolderInterface
public boolean isValueHolderInterface()INTERNAL: If somehow we are processing a class that was weaved to have value holders, we should ignore the processing of this mapping. -
process
public void process()INTERNAL: Common validation done by all relationship accessors.- Specified by:
processin classMetadataAccessor
-
processBatchFetch
INTERNAL: Set the batch fetch type on the foreign reference mapping. -
processCascadeTypes
INTERNAL: -
processJoinTable
protected void processJoinTable(ForeignReferenceMapping mapping, RelationTableMechanism mechanism, JoinTableMetadata joinTable) INTERNAL: Process a MetadataJoinTable. -
processMappedByRelationTable
protected void processMappedByRelationTable(RelationTableMechanism ownerMechanism, RelationTableMechanism mechanism) INTERNAL: -
processOrphanRemoval
INTERNAL: This method should be called for all mappings even though they may not support. The reason is that we want to log a message for those mappings that try to employ a private owned setting when it is not supported on their mapping. Order of checking is as follows: 1 - check for orphanRemoval first. Through meta data, this can only be true for 1-1, 1-M and V1-1 2 - check for isPrivateOwned. Do no check the variable directly as the isPrivateOwned method is overridden in those classes that do not support it (to check if the user decorated the mapping with a private owned and log a warning message that we are ignoring it.) -
processRelationshipMapping
INTERNAL: Process settings common to ForeignReferenceMapping. -
setAccessorMethods
INTERNAL: Set the getter and setter access methods for this accessor.- Overrides:
setAccessorMethodsin classMappingAccessor
-
setBatchFetch
INTERNAL: Used for OX mapping. -
setCascade
INTERNAL: Used for OX mapping. -
setCascadeOnDelete
INTERNAL: Used for OX mapping. -
setFetch
INTERNAL: Used for OX mapping. -
setForeignKey
INTERNAL: Used for OX mapping. -
setJoinColumns
INTERNAL: Used for OX mapping. -
setJoinFields
INTERNAL: Used for OX mapping. -
setJoinFetch
INTERNAL: Used for OX mapping. -
setJoinTable
INTERNAL: Used for OX mapping. -
setMappedBy
INTERNAL: Used for OX mapping. -
setNonCacheable
INTERNAL: Used for OX mapping. -
setOrphanRemoval
INTERNAL: Used for OX mapping. -
setPrivateOwned
INTERNAL: Used for OX mapping. -
setTargetEntity
INTERNAL: -
setTargetEntityName
INTERNAL: Used for OX mapping. -
usesIndirection
protected boolean usesIndirection()INTERNAL:- Overrides:
usesIndirectionin classMappingAccessor- See Also:
-