Module org.eclipse.persistence.jpa
Class ObjectAccessor
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
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ObjectAccessor
- Direct Known Subclasses:
ManyToOneAccessor
,OneToOneAccessor
,VariableOneToOneAccessor
INTERNAL:
A single object relationship 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
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor
m_referenceClass
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
KEY_DOT_NOTATION, m_field, VALUE_DOT_NOTATION
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project
-
Constructor Summary
ModifierConstructorDescriptionprotected
ObjectAccessor
(String xmlElement) INTERNAL: Used for OX mapping.protected
ObjectAccessor
(MetadataAnnotation annotation, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionboolean
INTERNAL: Return true is this accessor is a derived id accessor.boolean
INTERNAL:INTERNAL: The attribute type for virtual object accessors is the target entity.INTERNAL: Return the default fetch type for an object mapping.getId()
INTERNAL:INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: If a target entity is specified in metadata, it will be set as the reference class, otherwise we will use the raw class.protected MetadataClass
INTERNAL: Used to process primary keys and DerivedIds.boolean
INTERNAL: Object accessors don't require a separate attribute-type specification in XML, instead they can use the reference class to determine the attribute-type.int
hashCode()
protected boolean
hasId()
INTERNAL:protected boolean
INTERNAL:protected ObjectReferenceMapping
INTERNAL: Initialize a ManyToOneMapping.protected ObjectReferenceMapping
INTERNAL: Initialize a OneToOneMapping.void
initXMLObject
(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:boolean
INTERNAL: Return true if this accessor represents a 1-1 primary key relationship.boolean
INTERNAL:protected void
processAssociationOverride
(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, DatabaseTable defaultTable, MetadataDescriptor owningDescriptor) INTERNAL: Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key.protected void
processAssociationOverride
(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, MetadataDescriptor owningDescriptor) INTERNAL: Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key.protected void
INTERNAL: Process the join columns for the owning side of a one to one mapping.protected void
processId
(OneToOneMapping mapping) INTERNAL: Used to process primary keys and DerivedIds.protected void
processMapsId
(OneToOneMapping oneToOneMapping) INTERNAL: Process the mapping keys from the maps id value.protected void
processMapsIdFields
(OneToOneMapping oneToOneMapping, EmbeddedIdAccessor embeddedIdAccessor, MappingAccessor mapsIdAccessor) INTERNAL: We're going to add field name translations where necessary.protected void
INTERNAL: Process the primary key join columns for the owning side of a one to one mapping.protected void
processOwningMappingKeys
(OneToOneMapping mapping) INTERNAL: Process the the correct metadata for the owning side of a one to one mapping.void
INTERNAL: Used for OX mapping.void
INTERNAL: Used for OX mapping.void
setOptional
(Boolean isOptional) INTERNAL: Used for OX mapping.void
setPrimaryKeyForeignKey
(PrimaryKeyForeignKeyMetadata primaryKeyForeignKey) INTERNAL: Used for OX mapping.void
setPrimaryKeyJoinColumns
(List<PrimaryKeyJoinColumnMetadata> primaryKeyJoinColumns) INTERNAL: Used for OX mapping.Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor
addJoinTableRelationKeyFields, getBatchFetch, getCascade, getCascadeOnDelete, getDefaultTableForEntityMapKey, getFetch, getForeignKey, getJoinColumns, getJoinFetch, getJoinFields, getJoinTable, getJoinTableMetadata, getLoggingContext, getMappedBy, getNonCacheable, getOrphanRemoval, getOwningMapping, getPrivateOwned, getReferenceDescriptor, getTargetEntity, getTargetEntityName, hasJoinTable, hasMappedBy, isCascadeOnDelete, isLazy, isNonCacheable, isOrphanRemoval, isPrivateOwned, isValueHolderInterface, process, processBatchFetch, processCascadeTypes, processJoinTable, processMappedByRelationTable, processOrphanRemoval, processRelationshipMapping, setAccessorMethods, setBatchFetch, setCascade, setCascadeOnDelete, setFetch, setForeignKey, setJoinColumns, setJoinFetch, setJoinFields, setJoinTable, setMappedBy, setNonCacheable, setOrphanRemoval, setPrivateOwned, setTargetEntity, setTargetEntityName, usesIndirection
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
addConvert, addConvertMetadata, addFieldNameTranslation, addMapKeyConvert, getAnnotation, getAssociationOverrides, getAttributeName, getAttributeOverride, getAttributeOverrides, getClassAccessor, getColumn, getConverts, getDatabaseField, getEnumerated, getField, getForeignKey, getGetMethodName, getJoinColumns, getJoinColumnsAndValidate, getLob, getMapKey, getMapKeyConverts, getMapKeyReferenceClass, getMapKeyReferenceClassName, getMapKeyReferenceClassWithGenerics, getMapping, getOwningDescriptor, getOwningDescriptors, getRawClass, getRawClassWithGenerics, getReferenceAccessors, getReferenceClassFromGeneric, getReferenceClassName, getReferenceClassWithGenerics, getReferenceDatabaseTable, getSetMethodName, getTemporal, hasAttributeOverride, 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, 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, usesVirtualAccess
Methods 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, setValuePartitioning
Methods 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
-
Constructor Details
-
ObjectAccessor
INTERNAL: Used for OX mapping. -
ObjectAccessor
protected ObjectAccessor(MetadataAnnotation annotation, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor) INTERNAL:
-
-
Method Details
-
equals
INTERNAL:- Overrides:
equals
in classRelationshipAccessor
-
hashCode
public int hashCode()- Overrides:
hashCode
in classRelationshipAccessor
-
derivesId
public boolean derivesId()INTERNAL: Return true is this accessor is a derived id accessor.- Overrides:
derivesId
in classMappingAccessor
- See Also:
-
getAttributeType
INTERNAL: The attribute type for virtual object accessors is the target entity.- Overrides:
getAttributeType
in classMappingAccessor
-
getDefaultFetchType
INTERNAL: Return the default fetch type for an object mapping.- Specified by:
getDefaultFetchType
in classRelationshipAccessor
-
getId
INTERNAL: -
getMapsId
INTERNAL: Used for OX mapping. -
getPrimaryKeyForeignKey
INTERNAL: Used for OX mapping. -
getPrimaryKeyJoinColumns
INTERNAL: Used for OX mapping. -
getOptional
INTERNAL: Used for OX mapping. -
getReferenceClass
INTERNAL: If a target entity is specified in metadata, it will be set as the reference class, otherwise we will use the raw class.- Overrides:
getReferenceClass
in classMappingAccessor
-
getSimplePKType
INTERNAL: Used to process primary keys and DerivedIds. -
hasAttributeType
public boolean hasAttributeType()INTERNAL: Object accessors don't require a separate attribute-type specification in XML, instead they can use the reference class to determine the attribute-type.- Overrides:
hasAttributeType
in classMappingAccessor
-
hasId
protected boolean hasId()INTERNAL: -
hasMapsId
protected boolean hasMapsId()INTERNAL: -
initManyToOneMapping
INTERNAL: Initialize a ManyToOneMapping. -
initOneToOneMapping
INTERNAL: Initialize a OneToOneMapping. -
initXMLObject
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:- Overrides:
initXMLObject
in classRelationshipAccessor
-
isOneToOnePrimaryKeyRelationship
public boolean isOneToOnePrimaryKeyRelationship()INTERNAL: Return true if this accessor represents a 1-1 primary key relationship. -
isOptional
public boolean isOptional()INTERNAL: -
processAssociationOverride
protected void processAssociationOverride(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, MetadataDescriptor owningDescriptor) INTERNAL: Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key.- Overrides:
processAssociationOverride
in classMappingAccessor
-
processAssociationOverride
protected void processAssociationOverride(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, DatabaseTable defaultTable, MetadataDescriptor owningDescriptor) INTERNAL: Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key. -
processId
INTERNAL: Used to process primary keys and DerivedIds. -
processMapsId
INTERNAL: Process the mapping keys from the maps id value. -
processMapsIdFields
protected void processMapsIdFields(OneToOneMapping oneToOneMapping, EmbeddedIdAccessor embeddedIdAccessor, MappingAccessor mapsIdAccessor) INTERNAL: We're going to add field name translations where necessary. If the user specified (erroneously that is) attribute overrides this will override them. -
processForeignKeyRelationship
INTERNAL: Process the join columns for the owning side of a one to one mapping. The default pk and pk field names are used only with single primary key entities. The processor should never get as far as to use them with entities that have a composite primary key (validation exception will be thrown). -
processOneToOnePrimaryKeyRelationship
INTERNAL: Process the primary key join columns for the owning side of a one to one mapping. The default pk and pk field names are used only with single primary key entities. The processor should never get as far as to use them with entities that have a composite primary key (validation exception will be thrown). -
processOwningMappingKeys
INTERNAL: Process the the correct metadata for the owning side of a one to one mapping. Note, the order of checking is important, that is, check for a mapsId first. -
setId
INTERNAL: Used for OX mapping. -
setMapsId
INTERNAL: Used for OX mapping. -
setOptional
INTERNAL: Used for OX mapping. -
setPrimaryKeyForeignKey
INTERNAL: Used for OX mapping. -
setPrimaryKeyJoinColumns
INTERNAL: Used for OX mapping.
-