Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings

public abstract Class MappingAccessor

extends MetadataAccessor
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor, org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.TransientAccessor, org.eclipse.persistence.internal.jpa.metadata.structures.StructureAccessor, org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.DirectAccessor, org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.EmbeddedAccessor
Imports
java.util.ArrayList, .Collection, .HashMap, .List, .Map, .Set, org.eclipse.persistence.annotations.Convert, .JoinFetchType, .Properties, .Property, .ReturnInsert, .ReturnUpdate, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.internal.descriptors.VirtualAttributeAccessor, org.eclipse.persistence.internal.helper.ClassConstants, .DatabaseField, .DatabaseTable, .Helper, org.eclipse.persistence.internal.indirection.TransparentIndirectionPolicy, .WeavedObjectBasicIndirectionPolicy, org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor, .MetadataHelper, .MetadataLogger, org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor, .PropertyMetadata, org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor, .EmbeddableAccessor, .EntityAccessor, org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject, .MetadataAnnotation, .MetadataClass, .MetadataMethod, org.eclipse.persistence.internal.jpa.metadata.columns.AssociationOverrideMetadata, .AttributeOverrideMetadata, .ColumnMetadata, .ForeignKeyMetadata, .JoinColumnMetadata, org.eclipse.persistence.internal.jpa.metadata.converters.AbstractConverterMetadata, .ClassInstanceMetadata, .ConvertMetadata, .EnumeratedMetadata, .JSONMetadata, .JsonValueMetadata, .KryoMetadata, .LobMetadata, .SerializedMetadata, .TemporalMetadata, .UUIDMetadata, .XMLMetadata, org.eclipse.persistence.internal.jpa.metadata.mappings.MapKeyMetadata, org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings, org.eclipse.persistence.internal.mappings.converters.AttributeNamePrefix, .AttributeNameTokenizer, org.eclipse.persistence.internal.queries.CollectionContainerPolicy, .MappedKeyMapContainerPolicy, org.eclipse.persistence.mappings.AggregateObjectMapping, .CollectionMapping, .ContainerMapping, .DatabaseMapping, .DirectMapMapping, .DirectToFieldMapping, .EmbeddableMapping, .ForeignReferenceMapping, .OneToOneMapping, org.eclipse.persistence.mappings.foundation.AbstractDirectMapping, .MapComponentMapping, .MapKeyMapping

INTERNAL: An abstract mapping accessor. Holds common metadata for all mappings. 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.
Author
Guy Pelletier
Since
EclipseLink 1.0

Field Summary

Modifier and TypeField and Description
private static final String
protected static final String
KEY_DOT_NOTATION

Dot notation key prefix.

private String
private ClassAccessor
protected ColumnMetadata
private DatabaseMapping
private DatabaseMapping
private Map<String, PropertyMetadata>
protected static final String
VALUE_DOT_NOTATION

Dot notation value prefix.

Constructor Summary

AccessConstructor and Description
protected
MappingAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor)

INTERNAL:

protected
MappingAccessor(String xmlElement)

INTERNAL:

Method Summary

Modifier and TypeMethod and Description
protected void
addConvert(ConvertMetadata convert)

INTERNAL: Subclasses that support converts need to override this method otherwise an exception will be thrown from those accessors that do not support them when a user has defined them on that accessor.

protected void
addConvertMetadata(ConvertMetadata convert)

INTERNAL: Add a JPA convert annotation to the converts list.

protected void
addFieldNameTranslation(EmbeddableMapping embeddableMapping, String overrideName, DatabaseField overrideField, MappingAccessor aggregatesAccessor)

INTERNAL: Process an attribute override for either an embedded object mapping, or an element collection mapping containing embeddable objects.

protected void
addMapKeyConvert(ConvertMetadata convert)

INTERNAL: Subclasses that support converts need to override this method otherwise an exception will be thrown from those accessors that do not support them when a user has defined them on that accessor.

public boolean
derivesId()

INTERNAL: Return true is this accessor is a derived id accessor.

public boolean
equals(Object
the reference object with which to compare.
objectToCompare
)

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor.equals.

INTERNAL: For merging and overriding to work properly, all ORMetadata must be able to compare themselves for metadata equality.
protected MetadataAnnotation
getAnnotation(String annotation)

Implements abstract org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor.getAnnotation.

INTERNAL: Return the annotation if it exists.
protected Map<String, AssociationOverrideMetadata>
getAssociationOverrides(List<AssociationOverrideMetadata> associationOverrides)

INTERNAL: Process the list of association overrides into a map, merging and overriding any association overrides where necessary with descriptor level association overrides.

public String
protected AttributeOverrideMetadata
getAttributeOverride(String loggingCtx)

INTERNAL: Return the attribute override for this accessor.

protected Map<String, AttributeOverrideMetadata>
getAttributeOverrides(List<AttributeOverrideMetadata> attributeOverrides)

INTERNAL: Process the list of attribute overrides into a map, merging and overriding any attribute overrides where necessary with descriptor level attribute overrides.

public String
getAttributeType()

INTERNAL: Used for OX mapping.

public ClassAccessor
getClassAccessor()

INTERNAL: Returns the class accessor on which this mapping was defined.

protected ColumnMetadata
getColumn(String loggingCtx)

INTERNAL: Subclasses should override this method to return the appropriate column for their mapping.

protected List<ConvertMetadata>
getConverts(List<ConvertMetadata> potentialConverts)

INTERNAL: Given the potential converts return them for processing unless there are overrides available from the descriptor.

protected DatabaseField
getDatabaseField(DatabaseTable defaultTable, String loggingCtx)

INTERNAL: Process column metadata details into a database field.

protected String
protected DatabaseTable
getDefaultTableForEntityMapKey()

INTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKey

public EnumeratedMetadata
getEnumerated(boolean isForMapKey)

INTERNAL: Return the enumerated metadata for this accessor.

public ColumnMetadata
getField()

INTERNAL: Used for OX mapping.

protected ForeignKeyMetadata
getForeignKey(ForeignKeyMetadata potentialForeignKey, MetadataDescriptor descriptor)

INTERNAL: Return the foreign key to use with this mapping accessor.

public String
getGetMethodName()

INTERNAL: Returns the get method name of a method accessor.

protected List<JoinColumnMetadata>
getJoinColumns(List<JoinColumnMetadata> potentialJoinColumns, MetadataDescriptor descriptor)

INTERNAL: Return the join columns to use with this mapping accessor.

protected List<JoinColumnMetadata>
getJoinColumnsAndValidate(List<JoinColumnMetadata> joinColumns, MetadataDescriptor referenceDescriptor)

INTERNAL: This method will validate the join columns and default any where necessary.

public LobMetadata
getLob(boolean isForMapKey)

INTERNAL: Return the lob metadata for this accessor.

public MapKeyMetadata
getMapKey()

INTERNAL: Return the map key if this mapping accessor employs one.

protected List<ConvertMetadata>
getMapKeyConverts(List<ConvertMetadata> potentialMapKeyConverts)

INTERNAL: Given the potential converts return them for processing unless there are overrides available from the descriptor.

public MetadataClass
getMapKeyReferenceClass()

INTERNAL: Return the map key reference class for this accessor if applicable.

public String
getMapKeyReferenceClassName()

INTERNAL: Return the map key reference class name

public MetadataClass
getMapKeyReferenceClassWithGenerics()

INTERNAL: Return the map key reference class for this accessor if applicable.

public DatabaseMapping
getMapping()

INTERNAL: Return the mapping that this accessor is associated to.

public MetadataDescriptor
getOwningDescriptor()

INTERNAL: Return the owning descriptor of this accessor.

public List<MetadataDescriptor>
getOwningDescriptors()

INTERNAL: Return the owning descriptors of this accessor.

public MetadataClass
getRawClass()

INTERNAL: Return the raw class for this accessor.

public MetadataClass
getRawClassWithGenerics()

INTERNAL: Return the raw class with any generic specifications for this accessor.

public Collection<MappingAccessor>
getReferenceAccessors()

INTERNAL: Return the mapping accessors associated with the reference descriptor.

public MetadataClass
getReferenceClass()

INTERNAL: Return the reference class for this accessor.

public MetadataClass
getReferenceClassFromGeneric()

INTERNAL: Attempts to return a reference class from a generic specification.

public String
getReferenceClassName()

INTERNAL: Return the reference class name for this accessor.

public MetadataClass
getReferenceClassWithGenerics()

INTERNAL: Return the reference class for this accessor.

protected DatabaseTable
getReferenceDatabaseTable()

INTERNAL: Return the reference descriptors table.

public MetadataDescriptor
getReferenceDescriptor()

INTERNAL: Return the reference metadata descriptor for this accessor.

public String
getSetMethodName()

INTERNAL: Returns the set method name of a method accessor.

public TemporalMetadata
getTemporal(boolean isForMapKey)

INTERNAL: Return the temporal metadata for this accessor.

protected boolean
hasAttributeOverride(String loggingCtx)

INTERNAL: Return true if we have an attribute override for this accessor.

public boolean
hasAttributeType()

INTERNAL: Those accessors that do not require a separate attribute-type specification for VIRTUAL accessors should override this method.

protected boolean
hasEnumerated(boolean isForMapKey)

INTERNAL: Return true if this accessor has temporal metadata.

public int
protected boolean
hasLob(boolean isForMapKey)

INTERNAL: Return true if this accessor has lob metadata.

public boolean
hasMapKey()

INTERNAL: Method should be overridden by those accessors that accept and use a map key.

protected boolean
hasReturnInsert()

INTERNAL: Method to check if this accessor has a ReturnInsert annotation.

protected boolean
hasReturnUpdate()

INTERNAL: Method to check if this accessor has a ReturnUpdate annotation.

public boolean
hasTemporal(boolean isForMapKey)

INTERNAL: Return true if this accessor has temporal metadata.

public void
initXMLMappingAccessor(ClassAccessor classAccessor)

INTERNAL: Init an xml mapping accessor with its necessary components.

public void
public boolean
isAnnotationPresent(String annotation)

Implements abstract org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor.isAnnotationPresent.

INTERNAL: Indicates whether the specified annotation is present on the annotated element for this accessor.
public boolean
isBasic()

INTERNAL: Return true if this accessor represents a basic mapping.

public boolean
isBasicCollection()

INTERNAL: Return true if this accessor represents a basic collection mapping.

public boolean
isBasicMap()

INTERNAL: Return true if this accessor represents a basic map mapping.

public boolean
isCollectionAccessor()

INTERNAL: Return true if this accessor represents a collection accessor.

public boolean
isDerivedIdClass()

INTERNAL: Return true if this accessor is a derived id class accessor.

public boolean
isDirectCollection()

INTERNAL: Return true if this accessor represents a direct collection mapping, which include basic collection, basic map and element collection accessors.

public boolean
isDirectEmbeddableCollection()

INTERNAL: Return true if this accessor represents an element collection that contains embeddable objects.

public boolean
isEmbedded()

INTERNAL: Return true if this accessor represents an aggregate mapping.

public boolean
isEmbeddedId()

INTERNAL: Return true if this accessor represents an aggregate id mapping.

protected boolean
isEnumerated(MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Return true if this represents an enum type mapping.

public boolean
isId()

INTERNAL: Return true if this accessor is part of the id.

protected boolean
isJson(MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Return true if this represents a JSON type mapping.

protected boolean
isLob(MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Return true if this accessor represents a BLOB/CLOB mapping.

public boolean
isManyToMany()

INTERNAL: Return true if this accessor represents a m-m relationship.

public boolean
isManyToOne()

INTERNAL: Return true if this accessor represents a m-1 relationship.

public boolean
isMapAccessor()

INTERNAL: Return true if this accessor uses a Map.

public boolean
isMappedKeyMapAccessor()

INTERNAL: Return true if this accessor is a mapped key map accessor.

public boolean
isMultitenantId()

INTERNAL: Return true if this accessor is a multitenant id mapping.

public boolean
isOneToMany()

INTERNAL: Return true if this accessor represents a 1-m relationship.

public boolean
isOneToOne()

INTERNAL: Return true if this accessor represents a 1-1 relationship.

protected boolean
isPrimitiveWrapperClass(MetadataClass cls)

INTERNAL: Returns true is the given class is primitive wrapper type.

public boolean
isProcessed()

Implements abstract org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor.isProcessed.

INTERNAL: Return true if this accessor has been processed.
public boolean
isRelationship()

INTERNAL: Return true if this accessor method represents a relationship.

public boolean
isSerialized(MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Return true if this accessor represents a serialized mapping.

protected boolean
isTemporal(MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Return true if this represents a temporal type mapping.

protected boolean
public boolean
isTransient()

INTERNAL: Return true if this accessor represents a transient mapping.

protected boolean
isUUID(MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Return true if this represents a UUID type mapping.

protected boolean

Returns:

Value of true if the given class is valid for JsonMapping or false otherwise
isValidJsonType
(MetadataClass
class to validate
cls
)

INTERNAL: Check whether given class is valid for JsonMapping.

protected boolean
isValidSerializedType(MetadataClass cls)

INTERNAL: Returns true if the given class is valid for SerializedObjectMapping.

public boolean
isVariableOneToOne()

INTERNAL: Return true if this accessor represents a variable one to one mapping.

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
processAssociationOverrides(List<AssociationOverrideMetadata> associationOverrides, EmbeddableMapping embeddableMapping, MetadataDescriptor embeddableDescriptor)

INTERNAL: Process the association overrides for the given embeddable mapping which is either an embedded or element collection mapping.

protected void
processAttributeOverrides(List<AttributeOverrideMetadata> attributeOverrides, AggregateObjectMapping aggregateObjectMapping, MetadataDescriptor embeddableDescriptor)

INTERNAL: Process the attribute overrides for the given embedded mapping.

protected void
processContainerPolicyAndIndirection(ContainerMapping mapping)

INTERNAL: Process the map metadata if this is a valid map accessor.

protected void
processConvert(DatabaseMapping mapping, String converterName, MetadataClass referenceClass, boolean isForMapKey, boolean hasConverts)

INTERNAL: Process a Convert annotation or convert element to apply to specified EclipseLink converter (Converter, TypeConverter, ObjectTypeConverter) to the given mapping.

protected void
processConverts(List<ConvertMetadata> converts, DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Process the JPA defined convert(s)

protected AbstractDirectMapping
processDirectMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)

INTERNAL:

protected AggregateObjectMapping
processEmbeddableMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)

INTERNAL:

protected OneToOneMapping
processEntityMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)

INTERNAL: Process the map key to be an entity class.

protected void
processEnumerated(EnumeratedMetadata enumerated, DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Process an Enumerated setting.

protected void
processForeignKeyRelationship(ForeignReferenceMapping mapping, List<JoinColumnMetadata> joinColumns, ForeignKeyMetadata foreignKey, MetadataDescriptor referenceDescriptor, String defaultFKFieldName, DatabaseTable defaultFKTable)

INTERNAL: Process the join columns for the owning side of a one to one mapping.

protected void
processIndirection(ForeignReferenceMapping mapping)

INTERNAL: Process the indirection (aka fetch type)

protected void
processJoinFetch(String joinFetch, ForeignReferenceMapping mapping)

INTERNAL: Return the mapping join fetch type.

protected void
processJson(DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Process JSON value attribute for classes that extend JsonValue interface.

protected void
processLob(LobMetadata lob, DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Process a lob specification.

protected void
processMapKeyClass(ContainerMapping mapping, MappedKeyMapAccessor mappedKeyMapAccessor)

INTERNAL: Process a map key class for the given map key map accessor.

protected void
processMappingConverter(DatabaseMapping mapping, String convertValue, List<ConvertMetadata> converts, MetadataClass referenceClass, MetadataClass referenceClassWithGenerics, boolean isForMapKey)

INTERNAL: Process a convert value which specifies the name of an EclipseLink converter to process with this accessor's mapping.

protected void
processMappingKeyConverter(DatabaseMapping mapping, String convertValue, List<ConvertMetadata> converts, MetadataClass referenceClass, MetadataClass referenceClassWithGenerics)

INTERNAL: Process a mapping key converter either from an EclipseLink convert specification or a JPA converter specification (map-key-convert, map-key-temporal, map-key-enumerated) to be applied to the given mapping.

protected void
processMappingValueConverter(DatabaseMapping mapping, String convertValue, List<ConvertMetadata> converts, MetadataClass referenceClass, MetadataClass referenceClassWithGenerics)

INTERNAL: Process a convert value which specifies the name of an EclipseLink converter to process with this accessor's mapping.

protected void
processProperties(DatabaseMapping mapping)

INTERNAL: Adds properties to the mapping.

protected void
processProperty(DatabaseMapping mapping, PropertyMetadata property)

INTERNAL: Adds properties to the mapping.

protected void
processReturnInsert()

INTERNAL: Subclasses should call this method if they want the warning message or override the method if they want/support different behavior.

protected void
processReturnInsertAndUpdate()

INTERNAL: Subclasses should call this method if they want the warning message.

protected void
processReturnUpdate()

INTERNAL: Subclasses should call this method if they want the warning message or override the method if they want/support different behavior.

protected void
processSerialized(DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Process a potential serializable attribute.

protected void
processSerialized(DatabaseMapping mapping, MetadataClass referenceClass, MetadataClass classification, boolean isForMapKey)

INTERNAL: Process a potential serializable attribute.

protected void
processTemporal(TemporalMetadata temporal, DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Process a temporal type accessor.

protected void
processUUID(DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)

INTERNAL: Process a UUID attribute.

protected void
setAccessorMethods(DatabaseMapping mapping)

INTERNAL: Set the getter and setter access methods for this accessor.

public void
setAttributeType(String attributeType)

INTERNAL: Used for OX mapping.

public void
setClassAccessor(ClassAccessor classAccessor)

INTERNAL: Sets the class accessor for this mapping accessor.

public void
setField(ColumnMetadata column)

INTERNAL: Used for OX mapping.

protected void
setIndirectionPolicy(ContainerMapping mapping, String mapKey, boolean usesIndirection)

INTERNAL: Set the correct indirection policy on a collection mapping.

protected void
setMapping(DatabaseMapping mapping)

INTERNAL: This will do three things: 1 - process any common level metadata for all mappings.

protected void
setOverrideMapping(DatabaseMapping mapping)

INTERNAL: An override mapping is created when an association override is specified to a relationship accessor on an embeddable class.

protected void
setTemporal(TemporalMetadata metadata, boolean isForMapKey)

INTERNAL: Set the temporal metadata for this accessor.

public String
toString()

Overrides java.lang.Object.toString.

INTERNAL:
protected void
updatePrimaryKeyField(MappingAccessor idAccessor, DatabaseField overrideField)

INTERNAL: Update the primary key field on the owning descriptor the override field given.

public boolean
usesFieldAccess()

INTERNAL: Returns true if this mapping or class uses property field.

protected boolean
usesIndirection()

INTERNAL:

public boolean
usesPropertyAccess()

INTERNAL: Returns true if this mapping or class uses property access.

public boolean
usesVirtualAccess()

INTERNAL: Returns true if this mapping or class uses virtual access.

Inherited from org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor:
getAccessgetAccessibleObjectgetAccessMethodsgetAnnotatedElementgetAnnotatedElementNamegetAnnotationgetConvertersgetDefaultAttributeNamegetDescriptorgetDescriptorJavaClassgetHashPartitioninggetIdentifiergetJavaClassgetJavaClassNamegetNamegetObjectTypeConvertersgetPartitionedgetPartitioninggetPinnedPartitioninggetPropertiesgetRangePartitioninggetReferencedFieldgetReferencedFieldgetReplicationPartitioninggetRoundRobinPartitioninggetSerializedConvertersgetStructConvertersgetTypeConvertersgetUnionPartitioninggetUpperCaseShortJavaClassNamegetValuegetValuegetValuePartitioninghasAccesshasAccessMethodsinitAccessinitXMLAccessorisAnnotationPresentmergeprocessprocessConvertersprocessCustomConvertersprocessObjectTypeConvertersprocessPartitionedprocessPartitioningprocessPrimaryKeyJoinColumnsprocessSerializedConvertersprocessStructConvertersprocessTableprocessTypeConverterssetAccesssetAccessMethodssetConverterssetDescriptorsetHashPartitioningsetNamesetObjectTypeConverterssetPartitionedsetPartitioningsetPinnedPartitioningsetPropertiessetRangePartitioningsetReplicationPartitioningsetRoundRobinPartitioningsetSerializedConverterssetStructConverterssetTypeConverterssetUnionPartitioningsetValuePartitioning