Module org.eclipse.persistence.jpa
Class MetadataAccessor
java.lang.Object
org.eclipse.persistence.internal.jpa.metadata.ORMetadata
org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor
- Direct Known Subclasses:
ClassAccessor
,MappingAccessor
INTERNAL:
Common metadata accessor level for mappings and classes.
Key notes:
- any metadata mapped from XML to this class must be compared in the
equals method.
- any metadata mapped from XML to this class must be handled in the merge
method. (merging is done at the accessor/mapping level)
- any metadata mapped from XML to this class must be initialized in the
initXMLObject method.
- methods should be preserved in alphabetical order.
- Since:
- TopLink EJB 3.0 Reference Implementation
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project
-
Constructor Summary
ConstructorDescriptionMetadataAccessor
(String xmlElement) INTERNAL: Used for OX mapping.MetadataAccessor
(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, MetadataDescriptor descriptor, MetadataProject project) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionboolean
INTERNAL:INTERNAL: Used for OX mapping.INTERNAL: Returns the accessible object for this accessor.INTERNAL: Used for OX mapping.INTERNAL: Return the annotated element for this accessor.INTERNAL: Return the annotated element name for this accessor.getAnnotation
(Class<?> annotation) INTERNAL: Return the annotation if it exists.protected abstract MetadataAnnotation
getAnnotation
(String annotation) INTERNAL: Return the annotation if it exists.INTERNAL: Return the attribute name for this accessor.INTERNAL: Used for OX mapping.protected String
INTERNAL: Return the upper cased attribute name for this accessor.INTERNAL: Return the MetadataDescriptor for this accessor.INTERNAL: Return the java class tied to this class accessor's descriptor.INTERNAL: Used for OX mapping.INTERNAL: To satisfy the abstract getIdentifier() method from ORMetadata.INTERNAL: Return the java class associated with this accessor's descriptor.protected String
INTERNAL: Return the java class that defines this accessor.getName()
INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.protected DatabaseField
getReferencedField
(String referencedColumnName, MetadataDescriptor referenceDescriptor, String context) INTERNAL: Return the referenced field.protected DatabaseField
getReferencedField
(String referencedColumnName, MetadataDescriptor referenceDescriptor, String context, boolean isForAggregateCollection) INTERNAL: Return the referenced field.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.protected String
INTERNAL: Return the upper case java class that defines this accessor.protected Integer
INTERNAL: Helper method to return a string value if specified, otherwise returns the default value.protected String
INTERNAL: Helper method to return a string value if specified, otherwise returns the default value.INTERNAL: Used for OX mapping.boolean
INTERNAL:boolean
INTERNAL:int
hashCode()
void
INTERNAL: Called from annotation and xml initialization.void
initXMLAccessor
(MetadataDescriptor descriptor, MetadataProject project) INTERNAL: This method should be subclassed in those methods that need to do extra initialization.void
initXMLObject
(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:boolean
isAnnotationPresent
(Class<? extends Annotation> annotation) INTERNAL: Return true if the annotation exists.abstract boolean
isAnnotationPresent
(String annotation) INTERNAL: Return the annotation if it exists.abstract boolean
Subclasses must handle this flag.void
merge
(ORMetadata metadata) INTERNAL: We currently limit this merging to the ClassAccessor level.abstract void
process()
INTERNAL: Every accessor knows how to process themselves since they have all the information they need.void
INTERNAL: Process and add the globally defined converters to the project.protected void
INTERNAL: Process the XML defined converters and check for a Converter annotation.protected void
INTERNAL: Process the XML defined object type converters and check for an ObjectTypeConverter annotation.void
processPartitioned
(String name) Set the policy on the descriptor or mapping.protected void
Process the partitioning policies defined on this element.protected List
<PrimaryKeyJoinColumnMetadata> processPrimaryKeyJoinColumns
(List<PrimaryKeyJoinColumnMetadata> primaryKeyJoinColumns) INTERNAL: Process the primary key join columms for this accessors annotated element.protected void
INTERNAL: Process a the XML defined serialized converters and check for a SerializedConverter annotation.protected void
INTERNAL: Process the XML defined struct converters and check for a StructConverter annotation.protected void
processTable
(TableMetadata table, String defaultName) INTERNAL: Common table processing for table, secondary table, join table and collection table.protected void
INTERNAL: Process a the XML defined type converters and check for a TypeConverter annotation.void
INTERNAL: Used for OX mapping.void
setAccessMethods
(AccessMethodsMetadata accessMethods) INTERNAL: Used for OX mapping.void
setConverters
(List<ConverterMetadata> converters) INTERNAL: Used for OX mapping.void
setDescriptor
(MetadataDescriptor descriptor) INTERNAL: Set the metadata descriptor for this accessor.void
setHashPartitioning
(HashPartitioningMetadata hashPartitioning) INTERNAL: Used for OX mapping.void
INTERNAL: Used for OX mapping.void
setObjectTypeConverters
(List<ObjectTypeConverterMetadata> objectTypeConverters) INTERNAL: Used for OX mapping.void
setPartitioned
(String partitioned) INTERNAL: Used for OX mapping.void
setPartitioning
(PartitioningMetadata partitioning) INTERNAL: Used for OX mapping.void
setPinnedPartitioning
(PinnedPartitioningMetadata pinnedPartitioning) INTERNAL: Used for OX mapping.void
setProperties
(List<PropertyMetadata> properties) INTERNAL: Used for OX mapping.void
setRangePartitioning
(RangePartitioningMetadata rangePartitioning) INTERNAL: Used for OX mapping.void
setReplicationPartitioning
(ReplicationPartitioningMetadata replicationPartitioning) INTERNAL: Used for OX mapping.void
setRoundRobinPartitioning
(RoundRobinPartitioningMetadata roundRobinPartitioning) INTERNAL: Used for OX mapping.void
setSerializedConverters
(List<SerializedConverterMetadata> serializedConverters) INTERNAL: Used for OX mapping.void
setStructConverters
(List<StructConverterMetadata> structConverters) INTERNAL: Used for OX mapping.void
setTypeConverters
(List<TypeConverterMetadata> typeConverters) INTERNAL: Used for OX mapping.void
setUnionPartitioning
(UnionPartitioningMetadata unionPartitioning) INTERNAL: Used for OX mapping.void
setValuePartitioning
(ValuePartitioningMetadata valuePartitioning) INTERNAL: Used for OX mapping.Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
getAccessibleObjectName, getAnnotation, getBoxedType, getDatabaseTypeEnum, getEntityMappings, getFullyQualifiedClassName, getJavaClass, getJavaClassName, getLoader, getLocation, getLogger, getMetadataClass, getMetadataClass, getMetadataClass, getMetadataFactory, getName, getPrimitiveClassForName, getProject, getText, getXMLElement, hasIdentifier, hasText, initXMLClassName, initXMLObject, initXMLObjects, initXMLTextObject, loadedFromAnnotation, loadedFromEclipseLinkXML, loadedFromXML, mergeORObjectLists, mergeORObjects, mergeSimpleObjects, reloadEntity, reloadMappedSuperclass, setAccessibleObject, setEntityMappings, setFieldName, setFieldName, setProject, shouldOverride, valuesMatch, valuesMatch
-
Constructor Details
-
MetadataAccessor
INTERNAL: Used for OX mapping. -
MetadataAccessor
public MetadataAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, MetadataDescriptor descriptor, MetadataProject project) INTERNAL:
-
-
Method Details
-
equals
INTERNAL:- Specified by:
equals
in classORMetadata
-
hashCode
public int hashCode() -
getAccess
INTERNAL: Used for OX mapping. -
getAccessibleObject
INTERNAL: Returns the accessible object for this accessor.- Overrides:
getAccessibleObject
in classORMetadata
-
getAccessMethods
INTERNAL: Used for OX mapping. -
getAnnotatedElement
INTERNAL: Return the annotated element for this accessor. -
getAnnotatedElementName
INTERNAL: Return the annotated element name for this accessor. -
getAnnotation
INTERNAL: Return the annotation if it exists. This method should only be called for non JPA annotations as loading those annotations classes is ok (and available). JPA annotations should be referenced only by name as to not introduce a compile dependency. -
getAnnotation
INTERNAL: Return the annotation if it exists. -
getAttributeName
INTERNAL: Return the attribute name for this accessor. -
getConverters
INTERNAL: Used for OX mapping. -
getDefaultAttributeName
INTERNAL: Return the upper cased attribute name for this accessor. Used when defaulting. -
getDescriptor
INTERNAL: Return the MetadataDescriptor for this accessor. -
getDescriptorJavaClass
INTERNAL: Return the java class tied to this class accessor's descriptor. -
getHashPartitioning
INTERNAL: Used for OX mapping. -
getIdentifier
INTERNAL: To satisfy the abstract getIdentifier() method from ORMetadata.- Overrides:
getIdentifier
in classORMetadata
- See Also:
-
getJavaClass
INTERNAL: Return the java class associated with this accessor's descriptor. -
getJavaClassName
INTERNAL: Return the java class that defines this accessor. -
getName
INTERNAL: Used for OX mapping. -
getObjectTypeConverters
INTERNAL: Used for OX mapping. -
getPartitioned
INTERNAL: Used for OX mapping. -
getPartitioning
INTERNAL: Used for OX mapping. -
getPinnedPartitioning
INTERNAL: Used for OX mapping. -
getProperties
INTERNAL: Used for OX mapping. -
getRangePartitioning
INTERNAL: Used for OX mapping. -
getReferencedField
protected DatabaseField getReferencedField(String referencedColumnName, MetadataDescriptor referenceDescriptor, String context) INTERNAL: Return the referenced field. If the referencedColumnName is not specified, it will default to the primary key of the referenced table. -
getReferencedField
protected DatabaseField getReferencedField(String referencedColumnName, MetadataDescriptor referenceDescriptor, String context, boolean isForAggregateCollection) INTERNAL: Return the referenced field. If the referencedColumnName is not specified, it will default to the primary key of the referenced table. -
getReplicationPartitioning
INTERNAL: Used for OX mapping. -
getRoundRobinPartitioning
INTERNAL: Used for OX mapping. -
getStructConverters
INTERNAL: Used for OX mapping. -
getTypeConverters
INTERNAL: Used for OX mapping. -
getSerializedConverters
INTERNAL: Used for OX mapping. -
getUnionPartitioning
INTERNAL: Used for OX mapping. -
getUpperCaseShortJavaClassName
INTERNAL: Return the upper case java class that defines this accessor. -
getValue
INTERNAL: Helper method to return a string value if specified, otherwise returns the default value. -
getValue
INTERNAL: Helper method to return a string value if specified, otherwise returns the default value. -
getValuePartitioning
INTERNAL: Used for OX mapping. -
hasAccess
public boolean hasAccess()INTERNAL: -
hasAccessMethods
public boolean hasAccessMethods()INTERNAL: -
initAccess
public void initAccess()INTERNAL: Called from annotation and xml initialization. -
initXMLAccessor
INTERNAL: This method should be subclassed in those methods that need to do extra initialization. -
initXMLObject
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:- Overrides:
initXMLObject
in classORMetadata
-
isAnnotationPresent
INTERNAL: Return true if the annotation exists. This method should only be called for non native annotations (i.e. JPA) as loading native annotations classes is ok since we know they are available from the jar. JPA annotations should be referenced only by name as to not introduce a compile dependency. -
isAnnotationPresent
INTERNAL: Return the annotation if it exists. -
isProcessed
public abstract boolean isProcessed()Subclasses must handle this flag. -
merge
INTERNAL: We currently limit this merging to the ClassAccessor level.- Overrides:
merge
in classORMetadata
-
process
public abstract void process()INTERNAL: Every accessor knows how to process themselves since they have all the information they need. -
processConverters
public void processConverters()INTERNAL: Process and add the globally defined converters to the project. -
processCustomConverters
protected void processCustomConverters()INTERNAL: Process the XML defined converters and check for a Converter annotation. -
processObjectTypeConverters
protected void processObjectTypeConverters()INTERNAL: Process the XML defined object type converters and check for an ObjectTypeConverter annotation. -
processPartitioned
Set the policy on the descriptor or mapping. -
processPartitioning
protected void processPartitioning()Process the partitioning policies defined on this element. -
processPrimaryKeyJoinColumns
protected List<PrimaryKeyJoinColumnMetadata> processPrimaryKeyJoinColumns(List<PrimaryKeyJoinColumnMetadata> primaryKeyJoinColumns) INTERNAL: Process the primary key join columms for this accessors annotated element. -
processStructConverters
protected void processStructConverters()INTERNAL: Process the XML defined struct converters and check for a StructConverter annotation. -
processTable
INTERNAL: Common table processing for table, secondary table, join table and collection table. -
processTypeConverters
protected void processTypeConverters()INTERNAL: Process a the XML defined type converters and check for a TypeConverter annotation. -
processSerializedConverters
protected void processSerializedConverters()INTERNAL: Process a the XML defined serialized converters and check for a SerializedConverter annotation. -
setAccess
INTERNAL: Used for OX mapping. -
setAccessMethods
INTERNAL: Used for OX mapping. -
setConverters
INTERNAL: Used for OX mapping. -
setDescriptor
INTERNAL: Set the metadata descriptor for this accessor. When setting the descriptor on entities, the owning descriptor is set to this descriptor. -
setHashPartitioning
INTERNAL: Used for OX mapping. -
setName
INTERNAL: Used for OX mapping. -
setObjectTypeConverters
INTERNAL: Used for OX mapping. -
setPartitioned
INTERNAL: Used for OX mapping. -
setPartitioning
INTERNAL: Used for OX mapping. -
setPinnedPartitioning
INTERNAL: Used for OX mapping. -
setProperties
INTERNAL: Used for OX mapping. -
setRangePartitioning
INTERNAL: Used for OX mapping. -
setReplicationPartitioning
INTERNAL: Used for OX mapping. -
setRoundRobinPartitioning
INTERNAL: Used for OX mapping. -
setStructConverters
INTERNAL: Used for OX mapping. -
setTypeConverters
INTERNAL: Used for OX mapping. -
setSerializedConverters
INTERNAL: Used for OX mapping. -
setUnionPartitioning
INTERNAL: Used for OX mapping. -
setValuePartitioning
INTERNAL: Used for OX mapping.
-