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
public abstract class ObjectAccessor extends RelationshipAccessor
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
- Author:
- Guy Pelletier
-
-
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
Constructors Modifier Constructor Description protectedObjectAccessor(java.lang.String xmlElement)INTERNAL: Used for OX mapping.protectedObjectAccessor(MetadataAnnotation annotation, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor)INTERNAL:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanderivesId()INTERNAL: Return true is this accessor is a derived id accessor.booleanequals(java.lang.Object objectToCompare)INTERNAL:java.lang.StringgetAttributeType()INTERNAL: The attribute type for virtual object accessors is the target entity.java.lang.StringgetDefaultFetchType()INTERNAL: Return the default fetch type for an object mapping.java.lang.BooleangetId()INTERNAL:java.lang.StringgetMapsId()INTERNAL: Used for OX mapping.java.lang.BooleangetOptional()INTERNAL: Used for OX mapping.PrimaryKeyForeignKeyMetadatagetPrimaryKeyForeignKey()INTERNAL: Used for OX mapping.java.util.List<PrimaryKeyJoinColumnMetadata>getPrimaryKeyJoinColumns()INTERNAL: Used for OX mapping.MetadataClassgetReferenceClass()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 MetadataClassgetSimplePKType()INTERNAL: Used to process primary keys and DerivedIds.booleanhasAttributeType()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.inthashCode()protected booleanhasId()INTERNAL:protected booleanhasMapsId()INTERNAL:protected org.eclipse.persistence.mappings.ObjectReferenceMappinginitManyToOneMapping()INTERNAL: Initialize a ManyToOneMapping.protected org.eclipse.persistence.mappings.ObjectReferenceMappinginitOneToOneMapping()INTERNAL: Initialize a OneToOneMapping.voidinitXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings)INTERNAL:booleanisOneToOnePrimaryKeyRelationship()INTERNAL: Return true if this accessor represents a 1-1 primary key relationship.booleanisOptional()INTERNAL:protected voidprocessAssociationOverride(AssociationOverrideMetadata associationOverride, org.eclipse.persistence.mappings.EmbeddableMapping embeddableMapping, org.eclipse.persistence.internal.helper.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, org.eclipse.persistence.mappings.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 voidprocessForeignKeyRelationship(org.eclipse.persistence.mappings.ObjectReferenceMapping mapping)INTERNAL: Process the join columns for the owning side of a one to one mapping.protected voidprocessId(org.eclipse.persistence.mappings.OneToOneMapping mapping)INTERNAL: Used to process primary keys and DerivedIds.protected voidprocessMapsId(org.eclipse.persistence.mappings.OneToOneMapping oneToOneMapping)INTERNAL: Process the mapping keys from the maps id value.protected voidprocessMapsIdFields(org.eclipse.persistence.mappings.OneToOneMapping oneToOneMapping, EmbeddedIdAccessor embeddedIdAccessor, MappingAccessor mapsIdAccessor)INTERNAL: We're going to add field name translations where necessary.protected voidprocessOneToOnePrimaryKeyRelationship(org.eclipse.persistence.mappings.OneToOneMapping mapping)INTERNAL: Process the primary key join columns for the owning side of a one to one mapping.protected voidprocessOwningMappingKeys(org.eclipse.persistence.mappings.OneToOneMapping mapping)INTERNAL: Process the the correct metadata for the owning side of a one to one mapping.voidsetId(java.lang.Boolean id)INTERNAL: Used for OX mapping.voidsetMapsId(java.lang.String mapsId)INTERNAL: Used for OX mapping.voidsetOptional(java.lang.Boolean isOptional)INTERNAL: Used for OX mapping.voidsetPrimaryKeyForeignKey(PrimaryKeyForeignKeyMetadata primaryKeyForeignKey)INTERNAL: Used for OX mapping.voidsetPrimaryKeyJoinColumns(java.util.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, isLob, isManyToMany, isManyToOne, isMapAccessor, isMappedKeyMapAccessor, isMultitenantId, isOneToMany, isOneToOne, isPrimitiveWrapperClass, isProcessed, isRelationship, isSerialized, isTemporal, isTimeClass, isTransient, isValidSerializedType, isVariableOneToOne, processAssociationOverrides, processAttributeOverrides, processContainerPolicyAndIndirection, processConvert, processConverts, processDirectMapKeyClass, processEmbeddableMapKeyClass, processEntityMapKeyClass, processEnumerated, processForeignKeyRelationship, processIndirection, processJoinFetch, processLob, processMapKeyClass, processMappingConverter, processMappingKeyConverter, processMappingValueConverter, processProperties, processProperty, processReturnInsert, processReturnInsertAndUpdate, processReturnUpdate, processSerialized, processSerialized, processTemporal, 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 Detail
-
ObjectAccessor
protected ObjectAccessor(java.lang.String xmlElement)
INTERNAL: Used for OX mapping.
-
ObjectAccessor
protected ObjectAccessor(MetadataAnnotation annotation, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor)
INTERNAL:
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object objectToCompare)
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:
ObjectAccessor
-
getAttributeType
public java.lang.String getAttributeType()
INTERNAL: The attribute type for virtual object accessors is the target entity.- Overrides:
getAttributeTypein classMappingAccessor
-
getDefaultFetchType
public java.lang.String getDefaultFetchType()
INTERNAL: Return the default fetch type for an object mapping.- Specified by:
getDefaultFetchTypein classRelationshipAccessor
-
getId
public java.lang.Boolean getId()
INTERNAL:
-
getMapsId
public java.lang.String getMapsId()
INTERNAL: Used for OX mapping.
-
getPrimaryKeyForeignKey
public PrimaryKeyForeignKeyMetadata getPrimaryKeyForeignKey()
INTERNAL: Used for OX mapping.
-
getPrimaryKeyJoinColumns
public java.util.List<PrimaryKeyJoinColumnMetadata> getPrimaryKeyJoinColumns()
INTERNAL: Used for OX mapping.
-
getOptional
public java.lang.Boolean getOptional()
INTERNAL: Used for OX mapping.
-
getReferenceClass
public MetadataClass 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
protected MetadataClass 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
protected org.eclipse.persistence.mappings.ObjectReferenceMapping initManyToOneMapping()
INTERNAL: Initialize a ManyToOneMapping.
-
initOneToOneMapping
protected org.eclipse.persistence.mappings.ObjectReferenceMapping 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, org.eclipse.persistence.mappings.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, org.eclipse.persistence.mappings.EmbeddableMapping embeddableMapping, org.eclipse.persistence.internal.helper.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
protected void processId(org.eclipse.persistence.mappings.OneToOneMapping mapping)
INTERNAL: Used to process primary keys and DerivedIds.
-
processMapsId
protected void processMapsId(org.eclipse.persistence.mappings.OneToOneMapping oneToOneMapping)
INTERNAL: Process the mapping keys from the maps id value.
-
processMapsIdFields
protected void processMapsIdFields(org.eclipse.persistence.mappings.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
protected void processForeignKeyRelationship(org.eclipse.persistence.mappings.ObjectReferenceMapping mapping)
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
protected void processOneToOnePrimaryKeyRelationship(org.eclipse.persistence.mappings.OneToOneMapping mapping)
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
protected void processOwningMappingKeys(org.eclipse.persistence.mappings.OneToOneMapping mapping)
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
public void setId(java.lang.Boolean id)
INTERNAL: Used for OX mapping.
-
setMapsId
public void setMapsId(java.lang.String mapsId)
INTERNAL: Used for OX mapping.
-
setOptional
public void setOptional(java.lang.Boolean isOptional)
INTERNAL: Used for OX mapping.
-
setPrimaryKeyForeignKey
public void setPrimaryKeyForeignKey(PrimaryKeyForeignKeyMetadata primaryKeyForeignKey)
INTERNAL: Used for OX mapping.
-
setPrimaryKeyJoinColumns
public void setPrimaryKeyJoinColumns(java.util.List<PrimaryKeyJoinColumnMetadata> primaryKeyJoinColumns)
INTERNAL: Used for OX mapping.
-
-