Module org.eclipse.persistence.jpa
Class MappingAccessor
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
- Direct Known Subclasses:
DirectAccessor
,EmbeddedAccessor
,RelationshipAccessor
,StructureAccessor
,TransientAccessor
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.
- Since:
- EclipseLink 1.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
Dot notation key prefix.protected ColumnMetadata
protected static final String
Dot notation value prefix.Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project
-
Constructor Summary
ModifierConstructorDescriptionprotected
MappingAccessor
(String xmlElement) INTERNAL:protected
MappingAccessor
(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.boolean
INTERNAL: Return true is this accessor is a derived id accessor.boolean
INTERNAL: For merging and overriding to work properly, all ORMetadata must be able to compare themselves for metadata equality.protected MetadataAnnotation
getAnnotation
(String annotation) 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.INTERNAL: Return the attribute name for this accessor.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.INTERNAL: Used for OX mapping.INTERNAL: Returns the class accessor on which this mapping was defined.protected ColumnMetadata
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
INTERNAL:protected DatabaseTable
INTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKeygetEnumerated
(boolean isForMapKey) INTERNAL: Return the enumerated metadata for this accessor.getField()
INTERNAL: Used for OX mapping.protected ForeignKeyMetadata
getForeignKey
(ForeignKeyMetadata potentialForeignKey, MetadataDescriptor descriptor) INTERNAL: Return the foreign key to use with this mapping accessor.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.getLob
(boolean isForMapKey) INTERNAL: Return the lob metadata for this accessor.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.INTERNAL: Return the map key reference class for this accessor if applicable.INTERNAL: Return the map key reference class nameINTERNAL: Return the map key reference class for this accessor if applicable.INTERNAL: Return the mapping that this accessor is associated to.INTERNAL: Return the owning descriptor of this accessor.INTERNAL: Return the owning descriptors of this accessor.INTERNAL: Return the raw class for this accessor.INTERNAL: Return the raw class with any generic specifications for this accessor.INTERNAL: Return the mapping accessors associated with the reference descriptor.INTERNAL: Return the reference class for this accessor.INTERNAL: Attempts to return a reference class from a generic specification.INTERNAL: Return the reference class name for this accessor.INTERNAL: Return the reference class for this accessor.protected DatabaseTable
INTERNAL: Return the reference descriptors table.INTERNAL: Return the reference metadata descriptor for this accessor.INTERNAL: Returns the set method name of a method accessor.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.boolean
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.int
hashCode()
protected boolean
hasLob
(boolean isForMapKey) INTERNAL: Return true if this accessor has lob metadata.boolean
INTERNAL: Method should be overridden by those accessors that accept and use a map key.protected boolean
INTERNAL: Method to check if this accessor has a ReturnInsert annotation.protected boolean
INTERNAL: Method to check if this accessor has a ReturnUpdate annotation.boolean
hasTemporal
(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.void
initXMLMappingAccessor
(ClassAccessor classAccessor) INTERNAL: Init an xml mapping accessor with its necessary components.void
initXMLObject
(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:boolean
isAnnotationPresent
(String annotation) INTERNAL: Indicates whether the specified annotation is present on the annotated element for this accessor.boolean
isBasic()
INTERNAL: Return true if this accessor represents a basic mapping.boolean
INTERNAL: Return true if this accessor represents a basic collection mapping.boolean
INTERNAL: Return true if this accessor represents a basic map mapping.boolean
INTERNAL: Return true if this accessor represents a collection accessor.boolean
INTERNAL: Return true if this accessor is a derived id class accessor.boolean
INTERNAL: Return true if this accessor represents a direct collection mapping, which include basic collection, basic map and element collection accessors.boolean
INTERNAL: Return true if this accessor represents an element collection that contains embeddable objects.boolean
INTERNAL: Return true if this accessor represents an aggregate mapping.boolean
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.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.boolean
INTERNAL: Return true if this accessor represents a m-m relationship.boolean
INTERNAL: Return true if this accessor represents a m-1 relationship.boolean
INTERNAL: Return true if this accessor uses a Map.boolean
INTERNAL: Return true if this accessor is a mapped key map accessor.boolean
INTERNAL: Return true if this accessor is a multitenant id mapping.boolean
INTERNAL: Return true if this accessor represents a 1-m relationship.boolean
INTERNAL: Return true if this accessor represents a 1-1 relationship.protected boolean
INTERNAL: Returns true is the given class is primitive wrapper type.boolean
INTERNAL: Return true if this accessor has been processed.boolean
INTERNAL: Return true if this accessor method represents a relationship.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
isTimeClass
(MetadataClass cls) boolean
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
INTERNAL: Check whether given class is valid for JsonMapping.protected boolean
INTERNAL: Returns true if the given class is valid for SerializedObjectMapping.boolean
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
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
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
INTERNAL: Subclasses should call this method if they want the warning message or override the method if they want/support different behavior.protected void
INTERNAL: Subclasses should call this method if they want the warning message.protected void
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.void
setAttributeType
(String attributeType) INTERNAL: Used for OX mapping.void
setClassAccessor
(ClassAccessor classAccessor) INTERNAL: Sets the class accessor for this mapping accessor.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.toString()
INTERNAL:protected void
updatePrimaryKeyField
(MappingAccessor idAccessor, DatabaseField overrideField) INTERNAL: Update the primary key field on the owning descriptor the override field given.boolean
INTERNAL: Returns true if this mapping or class uses property field.protected boolean
INTERNAL:boolean
INTERNAL: Returns true if this mapping or class uses property access.boolean
INTERNAL: Returns true if this mapping or class uses virtual access.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, process, 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
-
Field Details
-
KEY_DOT_NOTATION
Dot notation key prefix. -
VALUE_DOT_NOTATION
Dot notation value prefix. -
m_field
-
-
Constructor Details
-
MappingAccessor
protected MappingAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL: -
MappingAccessor
INTERNAL:
-
-
Method Details
-
addConvert
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. -
addConvertMetadata
INTERNAL: Add a JPA convert annotation to the converts list. If it is a map key convert, pass it on to the map key converts list. -
addFieldNameTranslation
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. -
addMapKeyConvert
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. -
derivesId
public boolean derivesId()INTERNAL: Return true is this accessor is a derived id accessor.- See Also:
-
equals
INTERNAL: For merging and overriding to work properly, all ORMetadata must be able to compare themselves for metadata equality.- Overrides:
equals
in classMetadataAccessor
-
hashCode
public int hashCode()- Overrides:
hashCode
in classMetadataAccessor
-
getAnnotation
INTERNAL: Return the annotation if it exists.- Specified by:
getAnnotation
in classMetadataAccessor
-
getAssociationOverrides
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. -
getAttributeName
INTERNAL: Return the attribute name for this accessor. This is typically the attribute name on the accessible object (i.e., field or property name), however, if access-methods have been specified, use the name attribute that was specified in XML. (e.g. basic name="sin") and not the property name of the get method from the access-methods specification.- Overrides:
getAttributeName
in classMetadataAccessor
-
getAttributeOverride
INTERNAL: Return the attribute override for this accessor. -
getAttributeOverrides
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. -
getAttributeType
INTERNAL: Used for OX mapping. Those accessors that do not require a separate attribute-type specification for VIRTUAL accessors should override this method. For example, one-to-one and many-to-one will its target-entity. variable-one-to-one will use its target-interface. -
getClassAccessor
INTERNAL: Returns the class accessor on which this mapping was defined. -
getColumn
INTERNAL: Subclasses should override this method to return the appropriate column for their mapping.- See Also:
-
getConverts
INTERNAL: Given the potential converts return them for processing unless there are overrides available from the descriptor. -
getDatabaseField
INTERNAL: Process column metadata details into a database field. This will set correct metadata and log defaulting messages to the user. It also looks for an attribute override. This method will call getColumn() which assumes the subclasses will return the appropriate ColumnMetadata to process based on the context provided.- See Also:
-
getDefaultFetchType
INTERNAL: -
getDefaultTableForEntityMapKey
INTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKey -
getEnumerated
INTERNAL: Return the enumerated metadata for this accessor.- See Also:
-
getField
INTERNAL: Used for OX mapping. -
getForeignKey
protected ForeignKeyMetadata getForeignKey(ForeignKeyMetadata potentialForeignKey, MetadataDescriptor descriptor) INTERNAL: Return the foreign key to use with this mapping accessor. This method will look for association overrides and use the foreign key from it instead (do as the association override says). -
getGetMethodName
INTERNAL: Returns the get method name of a method accessor. Note, this method should not be called when processing field access. -
getJoinColumns
protected List<JoinColumnMetadata> getJoinColumns(List<JoinColumnMetadata> potentialJoinColumns, MetadataDescriptor descriptor) INTERNAL: Return the join columns to use with this mapping accessor. This method will look for association overrides and use those instead if some are available. This method will validate the join columns and default any where necessary. -
getJoinColumnsAndValidate
protected List<JoinColumnMetadata> getJoinColumnsAndValidate(List<JoinColumnMetadata> joinColumns, MetadataDescriptor referenceDescriptor) INTERNAL: This method will validate the join columns and default any where necessary. -
getLob
INTERNAL: Return the lob metadata for this accessor.- See Also:
-
getMapping
INTERNAL: Return the mapping that this accessor is associated to. -
getOwningDescriptor
INTERNAL: Return the owning descriptor of this accessor. -
getOwningDescriptors
INTERNAL: Return the owning descriptors of this accessor. In most cases this is a single descriptor. Multiples can only exist when dealing with accessors for an embeddable that is shared. -
getMapKey
INTERNAL: Return the map key if this mapping accessor employs one. Those accessors that support it should override this method.- See Also:
-
getMapKeyConverts
INTERNAL: Given the potential converts return them for processing unless there are overrides available from the descriptor. -
getMapKeyReferenceClass
INTERNAL: Return the map key reference class for this accessor if applicable. It will try to extract a reference class from a generic specification. Parameterized generic keys on a MappedSuperclass will return void.class. If no generics are used, then it will return void.class. This avoids NPE's when processing JPA converters that can default (Enumerated and Temporal) based on the reference class. -
getMapKeyReferenceClassName
INTERNAL: Return the map key reference class name -
getMapKeyReferenceClassWithGenerics
INTERNAL: Return the map key reference class for this accessor if applicable. It will try to extract a reference class from a generic specification. If no generics are used, then it will return void.class. This avoids NPE's when processing JPA converters that can default (Enumerated and Temporal) based on the reference class. Future: this method is where we would provide a more explicit reference class to support an auto-apply jpa converter. Per the spec auto-apply converters are applied against basics only. -
getRawClass
INTERNAL: Return the raw class for this accessor. E.g. For an accessor with a type of java.util.Collection<Employee>, this method will return java.util.Collection. To check for the attribute type we must go through the method calls since some accessors define the attribute type through a target entity specification. Do not access the m_attributeType variable directly in this method. -
getRawClassWithGenerics
INTERNAL: Return the raw class with any generic specifications for this accessor. E.g. For an accessor with a type of java.util.Collection<Employee>, this method will return java.util.CollectionEmployee. To check for the attribute type we must go through the method calls since some accessors define the attribute type through a target entity specification. Do not access the m_attributeType variable directly in this method. -
getReferenceAccessors
INTERNAL: Return the mapping accessors associated with the reference descriptor. -
getReferenceClass
INTERNAL: Return the reference class for this accessor. By default the reference class is the raw class. Some accessors may need to override this method to drill down further. That is, try to extract a reference class from generics. -
getReferenceClassWithGenerics
INTERNAL: Return the reference class for this accessor. By default the reference class is the raw class. Some accessors may need to override this method to drill down further. That is, try to extract a reference class from generics. -
getReferenceClassFromGeneric
INTERNAL: Attempts to return a reference class from a generic specification. Note, this method may return null. -
getReferenceClassName
INTERNAL: Return the reference class name for this accessor. -
getReferenceDatabaseTable
INTERNAL: Return the reference descriptors table. By default it is the primary key table off the reference descriptor. Subclasses that care to return a different class should override this method.- See Also:
-
getReferenceDescriptor
INTERNAL: Return the reference metadata descriptor for this accessor. -
getSetMethodName
INTERNAL: Returns the set method name of a method accessor. Note, this method should not be called when processing field access. -
getTemporal
INTERNAL: Return the temporal metadata for this accessor.- See Also:
-
setTemporal
INTERNAL: Set the temporal metadata for this accessor.- See Also:
-
hasAttributeOverride
INTERNAL: Return true if we have an attribute override for this accessor. -
hasAttributeType
public boolean hasAttributeType()INTERNAL: Those accessors that do not require a separate attribute-type specification for VIRTUAL accessors should override this method. For example, one-to-one and many-to-one will its target-entity. variable-one-to-one will use its target-interface. -
hasEnumerated
protected boolean hasEnumerated(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.- See Also:
-
hasLob
protected boolean hasLob(boolean isForMapKey) INTERNAL: Return true if this accessor has lob metadata.- See Also:
-
hasMapKey
public boolean hasMapKey()INTERNAL: Method should be overridden by those accessors that accept and use a map key.- See Also:
-
hasReturnInsert
protected boolean hasReturnInsert()INTERNAL: Method to check if this accessor has a ReturnInsert annotation. -
hasReturnUpdate
protected boolean hasReturnUpdate()INTERNAL: Method to check if this accessor has a ReturnUpdate annotation. -
hasTemporal
public boolean hasTemporal(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.- See Also:
-
initXMLMappingAccessor
INTERNAL: Init an xml mapping accessor with its necessary components. -
initXMLObject
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:- Overrides:
initXMLObject
in classMetadataAccessor
-
isAnnotationPresent
INTERNAL: Indicates whether the specified annotation is present on the annotated element for this accessor. Method checks against the metadata complete flag.- Specified by:
isAnnotationPresent
in classMetadataAccessor
-
isBasic
public boolean isBasic()INTERNAL: Return true if this accessor represents a basic mapping. -
isBasicCollection
public boolean isBasicCollection()INTERNAL: Return true if this accessor represents a basic collection mapping. -
isBasicMap
public boolean isBasicMap()INTERNAL: Return true if this accessor represents a basic map mapping. -
isDerivedIdClass
public boolean isDerivedIdClass()INTERNAL: Return true if this accessor is a derived id class accessor. -
isDirectCollection
public boolean isDirectCollection()INTERNAL: Return true if this accessor represents a direct collection mapping, which include basic collection, basic map and element collection accessors. -
isDirectEmbeddableCollection
public boolean isDirectEmbeddableCollection()INTERNAL: Return true if this accessor represents an element collection that contains embeddable objects. -
isCollectionAccessor
public boolean isCollectionAccessor()INTERNAL: Return true if this accessor represents a collection accessor. -
isEmbedded
public boolean isEmbedded()INTERNAL: Return true if this accessor represents an aggregate mapping. -
isEmbeddedId
public boolean isEmbeddedId()INTERNAL: Return true if this accessor represents an aggregate id mapping. -
isEnumerated
INTERNAL: Return true if this represents an enum type mapping. Will return true if the accessor's reference class is an enum or if enumerated metadata exists. -
isId
public boolean isId()INTERNAL: Return true if this accessor is part of the id. -
isLob
INTERNAL: Return true if this accessor represents a BLOB/CLOB mapping. -
isManyToMany
public boolean isManyToMany()INTERNAL: Return true if this accessor represents a m-m relationship. -
isManyToOne
public boolean isManyToOne()INTERNAL: Return true if this accessor represents a m-1 relationship. -
isMapAccessor
public boolean isMapAccessor()INTERNAL: Return true if this accessor uses a Map. -
isMappedKeyMapAccessor
public boolean isMappedKeyMapAccessor()INTERNAL: Return true if this accessor is a mapped key map accessor. It is a map key accessor for two reasons, it's a map and it does not have a map key specified. NOTE: we can't check for a map key class since one may not have been explicitly specified. In this case, a generic value must be set and we check for one when adding accessors (and in turn set the map key class at that point) -
isMultitenantId
public boolean isMultitenantId()INTERNAL: Return true if this accessor is a multitenant id mapping. -
isOneToMany
public boolean isOneToMany()INTERNAL: Return true if this accessor represents a 1-m relationship. -
isOneToOne
public boolean isOneToOne()INTERNAL: Return true if this accessor represents a 1-1 relationship. -
isPrimitiveWrapperClass
INTERNAL: Returns true is the given class is primitive wrapper type. -
isTimeClass
-
isProcessed
public boolean isProcessed()INTERNAL: Return true if this accessor has been processed. If there is a mapping set, we have processed this accessor.- Specified by:
isProcessed
in classMetadataAccessor
-
isRelationship
public boolean isRelationship()INTERNAL: Return true if this accessor method represents a relationship. -
isSerialized
INTERNAL: Return true if this accessor represents a serialized mapping. -
isTemporal
INTERNAL: Return true if this represents a temporal type mapping. -
isUUID
INTERNAL: Return true if this represents a UUID type mapping. -
isJson
INTERNAL: Return true if this represents a JSON type mapping. -
isTransient
public boolean isTransient()INTERNAL: Return true if this accessor represents a transient mapping. -
isValidJsonType
INTERNAL: Check whether given class is valid for JsonMapping.- Parameters:
cls
- class to validate- Returns:
- Value of
true
if the given class is valid for JsonMapping orfalse
otherwise
-
isValidSerializedType
INTERNAL: Returns true if the given class is valid for SerializedObjectMapping. -
isVariableOneToOne
public boolean isVariableOneToOne()INTERNAL: Return true if this accessor represents a variable one to one mapping. -
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. This method should be implemented in those accessors that support association overrides. An exception is thrown otherwise the association is called against an unsupported accessor/relationship. -
processAssociationOverrides
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. Association overrides are used to specify different keys to a shared mapping. -
processAttributeOverrides
protected void processAttributeOverrides(List<AttributeOverrideMetadata> attributeOverrides, AggregateObjectMapping aggregateObjectMapping, MetadataDescriptor embeddableDescriptor) INTERNAL: Process the attribute overrides for the given embedded mapping. Attribute overrides are used to apply the correct field name translations of direct fields. Note an embedded object mapping may be supported as the map key to an element-collection, 1-M and M-M mapping. -
processContainerPolicyAndIndirection
INTERNAL: Process the map metadata if this is a valid map accessor. Will return the map key method name that should be use, null otherwise.- See Also:
-
processConvert
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. -
processConverts
protected void processConverts(List<ConvertMetadata> converts, DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey) INTERNAL: Process the JPA defined convert(s) -
processDirectMapKeyClass
INTERNAL: -
processEmbeddableMapKeyClass
protected AggregateObjectMapping processEmbeddableMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor) INTERNAL: -
processEntityMapKeyClass
INTERNAL: Process the map key to be an entity class. -
processEnumerated
protected void processEnumerated(EnumeratedMetadata enumerated, DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey) INTERNAL: Process an Enumerated setting. The method may still be called if no Enumerated metadata has been specified but the accessor's reference class is a valid enumerated type. -
processIndirection
INTERNAL: Process the indirection (aka fetch type) -
processJoinFetch
INTERNAL: Return the mapping join fetch type. -
processLob
protected void processLob(LobMetadata lob, DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey) INTERNAL: Process a lob specification. The lob must be specified to process and create a lob type mapping. -
processMapKeyClass
protected void processMapKeyClass(ContainerMapping mapping, MappedKeyMapAccessor mappedKeyMapAccessor) INTERNAL: Process a map key class for the given map key map accessor. -
processMappingConverter
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. -
processMappingKeyConverter
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. -
processMappingValueConverter
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. -
processForeignKeyRelationship
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. The default pk and fk 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). -
processProperties
INTERNAL: Adds properties to the mapping. -
processProperty
INTERNAL: Adds properties to the mapping. They can only come from one place, therefore if we add the same one twice we know to throw an exception. -
processReturnInsert
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.- See Also:
-
processReturnInsertAndUpdate
protected void processReturnInsertAndUpdate()INTERNAL: Subclasses should call this method if they want the warning message. -
processReturnUpdate
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.- See Also:
-
processJson
protected void processJson(DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey) INTERNAL: Process JSON value attribute for classes that extend JsonValue interface. Set JsonTypeConverter on the mapping. -
processSerialized
protected void processSerialized(DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey) INTERNAL: Process a potential serializable attribute. If the class implements the Serializable interface then set a SerializedObjectConverter on the mapping. -
processSerialized
protected void processSerialized(DatabaseMapping mapping, MetadataClass referenceClass, MetadataClass classification, boolean isForMapKey) INTERNAL: Process a potential serializable attribute. If the class implements the Serializable interface then set a SerializedObjectConverter on the mapping. -
processTemporal
protected void processTemporal(TemporalMetadata temporal, DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey) INTERNAL: Process a temporal type accessor. -
processUUID
protected void processUUID(DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey) INTERNAL: Process a UUID attribute. -
setAccessorMethods
INTERNAL: Set the getter and setter access methods for this accessor. -
setAttributeType
INTERNAL: Used for OX mapping. -
setClassAccessor
INTERNAL: Sets the class accessor for this mapping accessor. -
setField
INTERNAL: Used for OX mapping. -
setIndirectionPolicy
protected void setIndirectionPolicy(ContainerMapping mapping, String mapKey, boolean usesIndirection) INTERNAL: Set the correct indirection policy on a collection mapping. Method assume that the reference class has been set on the mapping before calling this method. -
setMapping
INTERNAL: This will do three things: 1 - process any common level metadata for all mappings. 2 - add the mapping to the internal descriptor. 3 - store the actual database mapping associated with this accessor. Calling this method is a must for all mapping accessors since it will help to: 1 - determine if the accessor has been processed, and 2 - sub processing will may need access to the mapping to set its metadata. -
setOverrideMapping
INTERNAL: An override mapping is created when an association override is specified to a relationship accessor on an embeddable class. For any non-owning relationship accessor referring to this accessor will need its override mapping and not the original mapping from the embeddable so that it can populate the right metadata. -
toString
INTERNAL: -
updatePrimaryKeyField
INTERNAL: Update the primary key field on the owning descriptor the override field given. -
usesIndirection
protected boolean usesIndirection()INTERNAL:- See Also:
-
usesPropertyAccess
public boolean usesPropertyAccess()INTERNAL: Returns true if this mapping or class uses property access. In an inheritance hierarchy, the subclasses inherit their access type from the parent (unless there is an explicit access setting). -
usesVirtualAccess
public boolean usesVirtualAccess()INTERNAL: Returns true if this mapping or class uses virtual access. In an inheritance hierarchy, the subclasses inherit their access type from the parent (unless there is an explicit access setting). -
usesFieldAccess
public boolean usesFieldAccess()INTERNAL: Returns true if this mapping or class uses property field. In an inheritance hierarchy, the subclasses inherit their access type from the parent (unless there is an explicit access setting).
-