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_referenceClassFields 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
ConstructorsModifierConstructorDescriptionprotectedObjectAccessor(String xmlElement) INTERNAL: Used for OX mapping.protectedObjectAccessor(MetadataAnnotation annotation, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionbooleanINTERNAL: Return true is this accessor is a derived id accessor.booleanINTERNAL: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 MetadataClassINTERNAL: Used to process primary keys and DerivedIds.booleanINTERNAL: Object accessors don't require a separate attribute-type specification in XML, instead they can use the reference class to determine the attribute-type.inthashCode()protected booleanhasId()INTERNAL:protected booleanINTERNAL:protected ObjectReferenceMappingINTERNAL: Initialize a ManyToOneMapping.protected ObjectReferenceMappingINTERNAL: Initialize a OneToOneMapping.voidinitXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:booleanINTERNAL: Return true if this accessor represents a 1-1 primary key relationship.booleanINTERNAL:protected voidprocessAssociationOverride(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 voidprocessAssociationOverride(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 voidINTERNAL: Process the join columns for the owning side of a one to one mapping.protected voidprocessId(OneToOneMapping mapping) INTERNAL: Used to process primary keys and DerivedIds.protected voidprocessMapsId(OneToOneMapping oneToOneMapping) INTERNAL: Process the mapping keys from the maps id value.protected voidprocessMapsIdFields(OneToOneMapping oneToOneMapping, EmbeddedIdAccessor embeddedIdAccessor, MappingAccessor mapsIdAccessor) INTERNAL: We're going to add field name translations where necessary.protected voidINTERNAL: Process the primary key join columns for the owning side of a one to one mapping.protected voidprocessOwningMappingKeys(OneToOneMapping mapping) INTERNAL: Process the the correct metadata for the owning side of a one to one mapping.voidINTERNAL: Used for OX mapping.voidINTERNAL: Used for OX mapping.voidsetOptional(Boolean isOptional) INTERNAL: Used for OX mapping.voidsetPrimaryKeyForeignKey(PrimaryKeyForeignKeyMetadata primaryKeyForeignKey) INTERNAL: Used for OX mapping.voidsetPrimaryKeyJoinColumns(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, usesIndirectionMethods 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, 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
-
Constructor Details
-
ObjectAccessor
INTERNAL: Used for OX mapping. -
ObjectAccessor
protected ObjectAccessor(MetadataAnnotation annotation, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor) INTERNAL:
-
-
Method Details
-
equals
INTERNAL:- Overrides:
equalsin classRelationshipAccessor
-
hashCode
public int hashCode()- Overrides:
hashCodein classRelationshipAccessor
-
derivesId
public boolean derivesId()INTERNAL: Return true is this accessor is a derived id accessor.- Overrides:
derivesIdin classMappingAccessor- See Also:
-
getAttributeType
INTERNAL: The attribute type for virtual object accessors is the target entity.- Overrides:
getAttributeTypein classMappingAccessor
-
getDefaultFetchType
INTERNAL: Return the default fetch type for an object mapping.- Specified by:
getDefaultFetchTypein 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:
getReferenceClassin 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:
hasAttributeTypein 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:
initXMLObjectin 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:
processAssociationOverridein 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.
-