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
public abstract class MappingAccessor extends MetadataAccessor
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
- Author:
- Guy Pelletier
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringKEY_DOT_NOTATIONDot notation key prefix.protected ColumnMetadatam_fieldprotected static java.lang.StringVALUE_DOT_NOTATIONDot notation value prefix.-
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMappingAccessor(java.lang.String xmlElement)INTERNAL:protectedMappingAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor)INTERNAL:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddConvert(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 voidaddConvertMetadata(ConvertMetadata convert)INTERNAL: Add a JPA convert annotation to the converts list.protected voidaddFieldNameTranslation(org.eclipse.persistence.mappings.EmbeddableMapping embeddableMapping, java.lang.String overrideName, org.eclipse.persistence.internal.helper.DatabaseField overrideField, MappingAccessor aggregatesAccessor)INTERNAL: Process an attribute override for either an embedded object mapping, or an element collection mapping containing embeddable objects.protected voidaddMapKeyConvert(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.booleanderivesId()INTERNAL: Return true is this accessor is a derived id accessor.booleanequals(java.lang.Object objectToCompare)INTERNAL: For merging and overriding to work properly, all ORMetadata must be able to compare themselves for metadata equality.protected MetadataAnnotationgetAnnotation(java.lang.String annotation)INTERNAL: Return the annotation if it exists.protected java.util.Map<java.lang.String,AssociationOverrideMetadata>getAssociationOverrides(java.util.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.java.lang.StringgetAttributeName()INTERNAL: Return the attribute name for this accessor.protected AttributeOverrideMetadatagetAttributeOverride(java.lang.String loggingCtx)INTERNAL: Return the attribute override for this accessor.protected java.util.Map<java.lang.String,AttributeOverrideMetadata>getAttributeOverrides(java.util.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.java.lang.StringgetAttributeType()INTERNAL: Used for OX mapping.ClassAccessorgetClassAccessor()INTERNAL: Returns the class accessor on which this mapping was defined.protected ColumnMetadatagetColumn(java.lang.String loggingCtx)INTERNAL: Subclasses should override this method to return the appropriate column for their mapping.protected java.util.List<ConvertMetadata>getConverts(java.util.List<ConvertMetadata> potentialConverts)INTERNAL: Given the potential converts return them for processing unless there are overrides available from the descriptor.protected org.eclipse.persistence.internal.helper.DatabaseFieldgetDatabaseField(org.eclipse.persistence.internal.helper.DatabaseTable defaultTable, java.lang.String loggingCtx)INTERNAL: Process column metadata details into a database field.protected java.lang.StringgetDefaultFetchType()INTERNAL:protected org.eclipse.persistence.internal.helper.DatabaseTablegetDefaultTableForEntityMapKey()INTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKeyEnumeratedMetadatagetEnumerated(boolean isForMapKey)INTERNAL: Return the enumerated metadata for this accessor.ColumnMetadatagetField()INTERNAL: Used for OX mapping.protected ForeignKeyMetadatagetForeignKey(ForeignKeyMetadata potentialForeignKey, MetadataDescriptor descriptor)INTERNAL: Return the foreign key to use with this mapping accessor.java.lang.StringgetGetMethodName()INTERNAL: Returns the get method name of a method accessor.protected java.util.List<JoinColumnMetadata>getJoinColumns(java.util.List<JoinColumnMetadata> potentialJoinColumns, MetadataDescriptor descriptor)INTERNAL: Return the join columns to use with this mapping accessor.protected java.util.List<JoinColumnMetadata>getJoinColumnsAndValidate(java.util.List<JoinColumnMetadata> joinColumns, MetadataDescriptor referenceDescriptor)INTERNAL: This method will validate the join columns and default any where necessary.LobMetadatagetLob(boolean isForMapKey)INTERNAL: Return the lob metadata for this accessor.MapKeyMetadatagetMapKey()INTERNAL: Return the map key if this mapping accessor employs one.protected java.util.List<ConvertMetadata>getMapKeyConverts(java.util.List<ConvertMetadata> potentialMapKeyConverts)INTERNAL: Given the potential converts return them for processing unless there are overrides available from the descriptor.MetadataClassgetMapKeyReferenceClass()INTERNAL: Return the map key reference class for this accessor if applicable.java.lang.StringgetMapKeyReferenceClassName()INTERNAL: Return the map key reference class nameMetadataClassgetMapKeyReferenceClassWithGenerics()INTERNAL: Return the map key reference class for this accessor if applicable.org.eclipse.persistence.mappings.DatabaseMappinggetMapping()INTERNAL: Return the mapping that this accessor is associated to.MetadataDescriptorgetOwningDescriptor()INTERNAL: Return the owning descriptor of this accessor.java.util.List<MetadataDescriptor>getOwningDescriptors()INTERNAL: Return the owning descriptors of this accessor.MetadataClassgetRawClass()INTERNAL: Return the raw class for this accessor.MetadataClassgetRawClassWithGenerics()INTERNAL: Return the raw class with any generic specifications for this accessor.java.util.Collection<MappingAccessor>getReferenceAccessors()INTERNAL: Return the mapping accessors associated with the reference descriptor.MetadataClassgetReferenceClass()INTERNAL: Return the reference class for this accessor.MetadataClassgetReferenceClassFromGeneric()INTERNAL: Attempts to return a reference class from a generic specification.java.lang.StringgetReferenceClassName()INTERNAL: Return the reference class name for this accessor.MetadataClassgetReferenceClassWithGenerics()INTERNAL: Return the reference class for this accessor.protected org.eclipse.persistence.internal.helper.DatabaseTablegetReferenceDatabaseTable()INTERNAL: Return the reference descriptors table.MetadataDescriptorgetReferenceDescriptor()INTERNAL: Return the reference metadata descriptor for this accessor.java.lang.StringgetSetMethodName()INTERNAL: Returns the set method name of a method accessor.TemporalMetadatagetTemporal(boolean isForMapKey)INTERNAL: Return the temporal metadata for this accessor.protected booleanhasAttributeOverride(java.lang.String loggingCtx)INTERNAL: Return true if we have an attribute override for this accessor.booleanhasAttributeType()INTERNAL: Those accessors that do not require a separate attribute-type specification for VIRTUAL accessors should override this method.protected booleanhasEnumerated(boolean isForMapKey)INTERNAL: Return true if this accessor has temporal metadata.inthashCode()protected booleanhasLob(boolean isForMapKey)INTERNAL: Return true if this accessor has lob metadata.booleanhasMapKey()INTERNAL: Method should be overridden by those accessors that accept and use a map key.protected booleanhasReturnInsert()INTERNAL: Method to check if this accessor has a ReturnInsert annotation.protected booleanhasReturnUpdate()INTERNAL: Method to check if this accessor has a ReturnUpdate annotation.booleanhasTemporal(boolean isForMapKey)INTERNAL: Return true if this accessor has temporal metadata.voidinitXMLMappingAccessor(ClassAccessor classAccessor)INTERNAL: Init an xml mapping accessor with its necessary components.voidinitXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings)INTERNAL:booleanisAnnotationPresent(java.lang.String annotation)INTERNAL: Indicates whether the specified annotation is present on the annotated element for this accessor.booleanisBasic()INTERNAL: Return true if this accessor represents a basic mapping.booleanisBasicCollection()INTERNAL: Return true if this accessor represents a basic collection mapping.booleanisBasicMap()INTERNAL: Return true if this accessor represents a basic map mapping.booleanisCollectionAccessor()INTERNAL: Return true if this accessor represents a collection accessor.booleanisDerivedIdClass()INTERNAL: Return true if this accessor is a derived id class accessor.booleanisDirectCollection()INTERNAL: Return true if this accessor represents a direct collection mapping, which include basic collection, basic map and element collection accessors.booleanisDirectEmbeddableCollection()INTERNAL: Return true if this accessor represents an element collection that contains embeddable objects.booleanisEmbedded()INTERNAL: Return true if this accessor represents an aggregate mapping.booleanisEmbeddedId()INTERNAL: Return true if this accessor represents an aggregate id mapping.protected booleanisEnumerated(MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Return true if this represents an enum type mapping.booleanisId()INTERNAL: Return true if this accessor is part of the id.protected booleanisLob(MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Return true if this accessor represents a BLOB/CLOB mapping.booleanisManyToMany()INTERNAL: Return true if this accessor represents a m-m relationship.booleanisManyToOne()INTERNAL: Return true if this accessor represents a m-1 relationship.booleanisMapAccessor()INTERNAL: Return true if this accessor uses a Map.booleanisMappedKeyMapAccessor()INTERNAL: Return true if this accessor is a mapped key map accessor.booleanisMultitenantId()INTERNAL: Return true if this accessor is a multitenant id mapping.booleanisOneToMany()INTERNAL: Return true if this accessor represents a 1-m relationship.booleanisOneToOne()INTERNAL: Return true if this accessor represents a 1-1 relationship.protected booleanisPrimitiveWrapperClass(MetadataClass cls)INTERNAL: Returns true is the given class is primitive wrapper type.booleanisProcessed()INTERNAL: Return true if this accessor has been processed.booleanisRelationship()INTERNAL: Return true if this accessor method represents a relationship.booleanisSerialized(MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Return true if this accessor represents a serialized mapping.protected booleanisTemporal(MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Return true if this represents a temporal type mapping.protected booleanisTimeClass(MetadataClass cls)booleanisTransient()INTERNAL: Return true if this accessor represents a transient mapping.protected booleanisValidSerializedType(MetadataClass cls)INTERNAL: Returns true if the given class is valid for SerializedObjectMapping.booleanisVariableOneToOne()INTERNAL: Return true if this accessor represents a variable one to one mapping.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 voidprocessAssociationOverrides(java.util.List<AssociationOverrideMetadata> associationOverrides, org.eclipse.persistence.mappings.EmbeddableMapping embeddableMapping, MetadataDescriptor embeddableDescriptor)INTERNAL: Process the association overrides for the given embeddable mapping which is either an embedded or element collection mapping.protected voidprocessAttributeOverrides(java.util.List<AttributeOverrideMetadata> attributeOverrides, org.eclipse.persistence.mappings.AggregateObjectMapping aggregateObjectMapping, MetadataDescriptor embeddableDescriptor)INTERNAL: Process the attribute overrides for the given embedded mapping.protected voidprocessContainerPolicyAndIndirection(org.eclipse.persistence.mappings.ContainerMapping mapping)INTERNAL: Process the map metadata if this is a valid map accessor.protected voidprocessConvert(org.eclipse.persistence.mappings.DatabaseMapping mapping, java.lang.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 voidprocessConverts(java.util.List<ConvertMetadata> converts, org.eclipse.persistence.mappings.DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Process the JPA defined convert(s)protected org.eclipse.persistence.mappings.foundation.AbstractDirectMappingprocessDirectMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)INTERNAL:protected org.eclipse.persistence.mappings.AggregateObjectMappingprocessEmbeddableMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)INTERNAL:protected org.eclipse.persistence.mappings.OneToOneMappingprocessEntityMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)INTERNAL: Process the map key to be an entity class.protected voidprocessEnumerated(EnumeratedMetadata enumerated, org.eclipse.persistence.mappings.DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Process an Enumerated setting.protected voidprocessForeignKeyRelationship(org.eclipse.persistence.mappings.ForeignReferenceMapping mapping, java.util.List<JoinColumnMetadata> joinColumns, ForeignKeyMetadata foreignKey, MetadataDescriptor referenceDescriptor, java.lang.String defaultFKFieldName, org.eclipse.persistence.internal.helper.DatabaseTable defaultFKTable)INTERNAL: Process the join columns for the owning side of a one to one mapping.protected voidprocessIndirection(org.eclipse.persistence.mappings.ForeignReferenceMapping mapping)INTERNAL: Process the indirection (aka fetch type)protected voidprocessJoinFetch(java.lang.String joinFetch, org.eclipse.persistence.mappings.ForeignReferenceMapping mapping)INTERNAL: Return the mapping join fetch type.protected voidprocessLob(LobMetadata lob, org.eclipse.persistence.mappings.DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Process a lob specification.protected voidprocessMapKeyClass(org.eclipse.persistence.mappings.ContainerMapping mapping, MappedKeyMapAccessor mappedKeyMapAccessor)INTERNAL: Process a map key class for the given map key map accessor.protected voidprocessMappingConverter(org.eclipse.persistence.mappings.DatabaseMapping mapping, java.lang.String convertValue, java.util.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 voidprocessMappingKeyConverter(org.eclipse.persistence.mappings.DatabaseMapping mapping, java.lang.String convertValue, java.util.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 voidprocessMappingValueConverter(org.eclipse.persistence.mappings.DatabaseMapping mapping, java.lang.String convertValue, java.util.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 voidprocessProperties(org.eclipse.persistence.mappings.DatabaseMapping mapping)INTERNAL: Adds properties to the mapping.protected voidprocessProperty(org.eclipse.persistence.mappings.DatabaseMapping mapping, PropertyMetadata property)INTERNAL: Adds properties to the mapping.protected voidprocessReturnInsert()INTERNAL: Subclasses should call this method if they want the warning message or override the method if they want/support different behavior.protected voidprocessReturnInsertAndUpdate()INTERNAL: Subclasses should call this method if they want the warning message.protected voidprocessReturnUpdate()INTERNAL: Subclasses should call this method if they want the warning message or override the method if they want/support different behavior.protected voidprocessSerialized(org.eclipse.persistence.mappings.DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Process a potential serializable attribute.protected voidprocessSerialized(org.eclipse.persistence.mappings.DatabaseMapping mapping, MetadataClass referenceClass, MetadataClass classification, boolean isForMapKey)INTERNAL: Process a potential serializable attribute.protected voidprocessTemporal(TemporalMetadata temporal, org.eclipse.persistence.mappings.DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)INTERNAL: Process a temporal type accessor.protected voidsetAccessorMethods(org.eclipse.persistence.mappings.DatabaseMapping mapping)INTERNAL: Set the getter and setter access methods for this accessor.voidsetAttributeType(java.lang.String attributeType)INTERNAL: Used for OX mapping.voidsetClassAccessor(ClassAccessor classAccessor)INTERNAL: Sets the class accessor for this mapping accessor.voidsetField(ColumnMetadata column)INTERNAL: Used for OX mapping.protected voidsetIndirectionPolicy(org.eclipse.persistence.mappings.ContainerMapping mapping, java.lang.String mapKey, boolean usesIndirection)INTERNAL: Set the correct indirection policy on a collection mapping.protected voidsetMapping(org.eclipse.persistence.mappings.DatabaseMapping mapping)INTERNAL: This will do three things: 1 - process any common level metadata for all mappings.protected voidsetOverrideMapping(org.eclipse.persistence.mappings.DatabaseMapping mapping)INTERNAL: An override mapping is created when an association override is specified to a relationship accessor on an embeddable class.protected voidsetTemporal(TemporalMetadata metadata, boolean isForMapKey)INTERNAL: Set the temporal metadata for this accessor.java.lang.StringtoString()INTERNAL:protected voidupdatePrimaryKeyField(MappingAccessor idAccessor, org.eclipse.persistence.internal.helper.DatabaseField overrideField)INTERNAL: Update the primary key field on the owning descriptor the override field given.booleanusesFieldAccess()INTERNAL: Returns true if this mapping or class uses property field.protected booleanusesIndirection()INTERNAL:booleanusesPropertyAccess()INTERNAL: Returns true if this mapping or class uses property access.booleanusesVirtualAccess()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 Detail
-
KEY_DOT_NOTATION
protected static final java.lang.String KEY_DOT_NOTATION
Dot notation key prefix.
-
VALUE_DOT_NOTATION
protected static final java.lang.String VALUE_DOT_NOTATION
Dot notation value prefix.
-
m_field
protected ColumnMetadata m_field
-
-
Constructor Detail
-
MappingAccessor
protected MappingAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor)
INTERNAL:
-
MappingAccessor
protected MappingAccessor(java.lang.String xmlElement)
INTERNAL:
-
-
Method Detail
-
addConvert
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.
-
addConvertMetadata
protected void addConvertMetadata(ConvertMetadata convert)
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(org.eclipse.persistence.mappings.EmbeddableMapping embeddableMapping, java.lang.String overrideName, org.eclipse.persistence.internal.helper.DatabaseField overrideField, MappingAccessor aggregatesAccessor)INTERNAL: Process an attribute override for either an embedded object mapping, or an element collection mapping containing embeddable objects.
-
addMapKeyConvert
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.
-
derivesId
public boolean derivesId()
INTERNAL: Return true is this accessor is a derived id accessor.- See Also:
ObjectAccessor
-
equals
public boolean equals(java.lang.Object objectToCompare)
INTERNAL: For merging and overriding to work properly, all ORMetadata must be able to compare themselves for metadata equality.- Overrides:
equalsin classMetadataAccessor
-
hashCode
public int hashCode()
- Overrides:
hashCodein classMetadataAccessor
-
getAnnotation
protected MetadataAnnotation getAnnotation(java.lang.String annotation)
INTERNAL: Return the annotation if it exists.- Specified by:
getAnnotationin classMetadataAccessor
-
getAssociationOverrides
protected java.util.Map<java.lang.String,AssociationOverrideMetadata> getAssociationOverrides(java.util.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
public java.lang.String 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:
getAttributeNamein classMetadataAccessor
-
getAttributeOverride
protected AttributeOverrideMetadata getAttributeOverride(java.lang.String loggingCtx)
INTERNAL: Return the attribute override for this accessor.
-
getAttributeOverrides
protected java.util.Map<java.lang.String,AttributeOverrideMetadata> getAttributeOverrides(java.util.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
public java.lang.String 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
public ClassAccessor getClassAccessor()
INTERNAL: Returns the class accessor on which this mapping was defined.
-
getColumn
protected ColumnMetadata getColumn(java.lang.String loggingCtx)
INTERNAL: Subclasses should override this method to return the appropriate column for their mapping.
-
getConverts
protected java.util.List<ConvertMetadata> getConverts(java.util.List<ConvertMetadata> potentialConverts)
INTERNAL: Given the potential converts return them for processing unless there are overrides available from the descriptor.
-
getDatabaseField
protected org.eclipse.persistence.internal.helper.DatabaseField getDatabaseField(org.eclipse.persistence.internal.helper.DatabaseTable defaultTable, java.lang.String loggingCtx)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.
-
getDefaultFetchType
protected java.lang.String getDefaultFetchType()
INTERNAL:
-
getDefaultTableForEntityMapKey
protected org.eclipse.persistence.internal.helper.DatabaseTable getDefaultTableForEntityMapKey()
INTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKey
-
getEnumerated
public EnumeratedMetadata getEnumerated(boolean isForMapKey)
INTERNAL: Return the enumerated metadata for this accessor.
-
getField
public ColumnMetadata 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
public java.lang.String getGetMethodName()
INTERNAL: Returns the get method name of a method accessor. Note, this method should not be called when processing field access.
-
getJoinColumns
protected java.util.List<JoinColumnMetadata> getJoinColumns(java.util.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 java.util.List<JoinColumnMetadata> getJoinColumnsAndValidate(java.util.List<JoinColumnMetadata> joinColumns, MetadataDescriptor referenceDescriptor)
INTERNAL: This method will validate the join columns and default any where necessary.
-
getLob
public LobMetadata getLob(boolean isForMapKey)
INTERNAL: Return the lob metadata for this accessor.- See Also:
DirectAccessor
-
getMapping
public org.eclipse.persistence.mappings.DatabaseMapping getMapping()
INTERNAL: Return the mapping that this accessor is associated to.
-
getOwningDescriptor
public MetadataDescriptor getOwningDescriptor()
INTERNAL: Return the owning descriptor of this accessor.
-
getOwningDescriptors
public java.util.List<MetadataDescriptor> 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
public MapKeyMetadata getMapKey()
INTERNAL: Return the map key if this mapping accessor employs one. Those accessors that support it should override this method.- See Also:
CollectionAccessor,ElementCollectionAccessor
-
getMapKeyConverts
protected java.util.List<ConvertMetadata> getMapKeyConverts(java.util.List<ConvertMetadata> potentialMapKeyConverts)
INTERNAL: Given the potential converts return them for processing unless there are overrides available from the descriptor.
-
getMapKeyReferenceClass
public MetadataClass 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
public java.lang.String getMapKeyReferenceClassName()
INTERNAL: Return the map key reference class name
-
getMapKeyReferenceClassWithGenerics
public MetadataClass 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
public MetadataClass 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
public MetadataClass 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
public java.util.Collection<MappingAccessor> getReferenceAccessors()
INTERNAL: Return the mapping accessors associated with the reference descriptor.
-
getReferenceClass
public MetadataClass 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
public MetadataClass 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
public MetadataClass getReferenceClassFromGeneric()
INTERNAL: Attempts to return a reference class from a generic specification. Note, this method may return null.
-
getReferenceClassName
public java.lang.String getReferenceClassName()
INTERNAL: Return the reference class name for this accessor.
-
getReferenceDatabaseTable
protected org.eclipse.persistence.internal.helper.DatabaseTable 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:
DirectCollectionAccessor,ManyToManyAccessor
-
getReferenceDescriptor
public MetadataDescriptor getReferenceDescriptor()
INTERNAL: Return the reference metadata descriptor for this accessor.
-
getSetMethodName
public java.lang.String getSetMethodName()
INTERNAL: Returns the set method name of a method accessor. Note, this method should not be called when processing field access.
-
getTemporal
public TemporalMetadata getTemporal(boolean isForMapKey)
INTERNAL: Return the temporal metadata for this accessor.- See Also:
DirectAccessor,CollectionAccessor
-
setTemporal
protected void setTemporal(TemporalMetadata metadata, boolean isForMapKey)
INTERNAL: Set the temporal metadata for this accessor.- See Also:
DirectAccessor,CollectionAccessor
-
hasAttributeOverride
protected boolean hasAttributeOverride(java.lang.String loggingCtx)
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.
-
hasLob
protected boolean hasLob(boolean isForMapKey)
INTERNAL: Return true if this accessor has lob metadata.
-
hasMapKey
public boolean hasMapKey()
INTERNAL: Method should be overridden by those accessors that accept and use a map key.
-
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.
-
initXMLMappingAccessor
public void initXMLMappingAccessor(ClassAccessor classAccessor)
INTERNAL: Init an xml mapping accessor with its necessary components.
-
initXMLObject
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings)
INTERNAL:- Overrides:
initXMLObjectin classMetadataAccessor
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.String annotation)
INTERNAL: Indicates whether the specified annotation is present on the annotated element for this accessor. Method checks against the metadata complete flag.- Specified by:
isAnnotationPresentin 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
protected boolean isEnumerated(MetadataClass referenceClass, boolean isForMapKey)
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
protected boolean isLob(MetadataClass referenceClass, boolean isForMapKey)
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
protected boolean isPrimitiveWrapperClass(MetadataClass cls)
INTERNAL: Returns true is the given class is primitive wrapper type.
-
isTimeClass
protected boolean isTimeClass(MetadataClass cls)
-
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:
isProcessedin classMetadataAccessor- Returns:
-
isRelationship
public boolean isRelationship()
INTERNAL: Return true if this accessor method represents a relationship.
-
isSerialized
public boolean isSerialized(MetadataClass referenceClass, boolean isForMapKey)
INTERNAL: Return true if this accessor represents a serialized mapping.
-
isTemporal
protected boolean isTemporal(MetadataClass referenceClass, boolean isForMapKey)
INTERNAL: Return true if this represents a temporal type mapping.
-
isTransient
public boolean isTransient()
INTERNAL: Return true if this accessor represents a transient mapping.
-
isValidSerializedType
protected boolean isValidSerializedType(MetadataClass cls)
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, 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. 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(java.util.List<AssociationOverrideMetadata> associationOverrides, org.eclipse.persistence.mappings.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(java.util.List<AttributeOverrideMetadata> attributeOverrides, org.eclipse.persistence.mappings.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
protected void processContainerPolicyAndIndirection(org.eclipse.persistence.mappings.ContainerMapping mapping)
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:
CollectionAccessor,ElementCollectionAccessor
-
processConvert
protected void processConvert(org.eclipse.persistence.mappings.DatabaseMapping mapping, java.lang.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(java.util.List<ConvertMetadata> converts, org.eclipse.persistence.mappings.DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)
INTERNAL: Process the JPA defined convert(s)
-
processDirectMapKeyClass
protected org.eclipse.persistence.mappings.foundation.AbstractDirectMapping processDirectMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)
INTERNAL:
-
processEmbeddableMapKeyClass
protected org.eclipse.persistence.mappings.AggregateObjectMapping processEmbeddableMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)
INTERNAL:
-
processEntityMapKeyClass
protected org.eclipse.persistence.mappings.OneToOneMapping processEntityMapKeyClass(MappedKeyMapAccessor mappedKeyMapAccessor)
INTERNAL: Process the map key to be an entity class.
-
processEnumerated
protected void processEnumerated(EnumeratedMetadata enumerated, org.eclipse.persistence.mappings.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
protected void processIndirection(org.eclipse.persistence.mappings.ForeignReferenceMapping mapping)
INTERNAL: Process the indirection (aka fetch type)
-
processJoinFetch
protected void processJoinFetch(java.lang.String joinFetch, org.eclipse.persistence.mappings.ForeignReferenceMapping mapping)INTERNAL: Return the mapping join fetch type.
-
processLob
protected void processLob(LobMetadata lob, org.eclipse.persistence.mappings.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(org.eclipse.persistence.mappings.ContainerMapping mapping, MappedKeyMapAccessor mappedKeyMapAccessor)INTERNAL: Process a map key class for the given map key map accessor.
-
processMappingConverter
protected void processMappingConverter(org.eclipse.persistence.mappings.DatabaseMapping mapping, java.lang.String convertValue, java.util.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(org.eclipse.persistence.mappings.DatabaseMapping mapping, java.lang.String convertValue, java.util.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(org.eclipse.persistence.mappings.DatabaseMapping mapping, java.lang.String convertValue, java.util.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(org.eclipse.persistence.mappings.ForeignReferenceMapping mapping, java.util.List<JoinColumnMetadata> joinColumns, ForeignKeyMetadata foreignKey, MetadataDescriptor referenceDescriptor, java.lang.String defaultFKFieldName, org.eclipse.persistence.internal.helper.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
protected void processProperties(org.eclipse.persistence.mappings.DatabaseMapping mapping)
INTERNAL: Adds properties to the mapping.
-
processProperty
protected void processProperty(org.eclipse.persistence.mappings.DatabaseMapping mapping, PropertyMetadata property)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:
BasicAccessor
-
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:
BasicAccessor
-
processSerialized
protected void processSerialized(org.eclipse.persistence.mappings.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(org.eclipse.persistence.mappings.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, org.eclipse.persistence.mappings.DatabaseMapping mapping, MetadataClass referenceClass, boolean isForMapKey)
INTERNAL: Process a temporal type accessor.
-
setAccessorMethods
protected void setAccessorMethods(org.eclipse.persistence.mappings.DatabaseMapping mapping)
INTERNAL: Set the getter and setter access methods for this accessor.
-
setAttributeType
public void setAttributeType(java.lang.String attributeType)
INTERNAL: Used for OX mapping.
-
setClassAccessor
public void setClassAccessor(ClassAccessor classAccessor)
INTERNAL: Sets the class accessor for this mapping accessor.
-
setField
public void setField(ColumnMetadata column)
INTERNAL: Used for OX mapping.
-
setIndirectionPolicy
protected void setIndirectionPolicy(org.eclipse.persistence.mappings.ContainerMapping mapping, java.lang.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
protected void setMapping(org.eclipse.persistence.mappings.DatabaseMapping mapping)
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
protected void setOverrideMapping(org.eclipse.persistence.mappings.DatabaseMapping mapping)
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
public java.lang.String toString()
INTERNAL:- Overrides:
toStringin classjava.lang.Object
-
updatePrimaryKeyField
protected void updatePrimaryKeyField(MappingAccessor idAccessor, org.eclipse.persistence.internal.helper.DatabaseField overrideField)
INTERNAL: Update the primary key field on the owning descriptor the override field given.
-
usesIndirection
protected boolean usesIndirection()
INTERNAL:- See Also:
RelationshipAccessor,DirectAccessor
-
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).
-
-