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

public Class MetadataDescriptor

extends Object
Class Inheritance
Static Imports
org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_ACCESS_FIELD, .MetadataConstants.JPA_ACCESS_PROPERTY

INTERNAL: Common metatata descriptor for the annotation and xml processors. This class is a wrap on an actual EclipseLink descriptor.
Author
Guy Pelletier
Since
TopLink EJB 3.0 Reference Implementation

Field Summary

Modifier and TypeField and Description
private Map<String, AssociationOverrideMetadata>
private Map<String, AttributeOverrideMetadata>
private Map<String, Map<String, MetadataAccessor>>
private Boolean
m_cacheable

Entity @Cacheable annotation value (cacheable value of this descriptor).

private ClassAccessor
private Map<String, List<ConvertMetadata>>
private String
private AccessMethodsMetadata
private String
private String
private List<TenantDiscriminatorColumnMetadata>
private List<ObjectAccessor>
private ClassDescriptor
private List<MetadataDescriptor>
private EmbeddedIdAccessor
private String
private Map<String, DatabaseField>
private Map<String, String>
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private Map<String, IdAccessor>
private List<String>
private List<String>
private MetadataDescriptor
private MetadataDescriptor
private boolean
private MetadataClass
private Map<String, List<ConvertMetadata>>
private Map<String, MappingAccessor>
private MetadataDescriptor
private List<String>
private MetadataClass
private Map<String, String>
private Map<DatabaseField, DatabaseField>
private Map<DatabaseField, MappingAccessor>
private DatabaseTable
private Map<String, PropertyMetadata>
private Boolean

Constructor Summary

AccessConstructor and Description
public
MetadataDescriptor(MetadataClass javaClass)

INTERNAL:

public
MetadataDescriptor(MetadataClass javaClass, ClassAccessor classAccessor)

INTERNAL:

Method Summary

Modifier and TypeMethod and Description
public void
public void
addAttributeOverride(AttributeOverrideMetadata attributeOverride)

INTERNAL:

public void
addConvert(String attributeName, ConvertMetadata convert)

INTERNAL: Add a convert to override a superclass class mapping.

public void
public void
addEmbeddableDescriptor(MetadataDescriptor embeddableDescriptor)

INTERNAL:

public void
public void
addField(DatabaseField field)

INTERNAL: Add a field from a basic mapping from this descriptor.

public void
public void
public void
public void
public void
addGenericType(String genericName, String type)

INTERNAL: Add a generic type for this descriptor.

public void
addIdAttributeName(String idAttributeName)

INTERNAL:

public void
addMapKeyConvert(String attributeName, ConvertMetadata convert)

INTERNAL: Add a map key convert to override a superclass class mapping.

public void
addMappingAccessor(MappingAccessor accessor)

INTERNAL: If the accessor is an IdAccessor we store it in a separate map for use during MappedSuperclass processing.

public void
addPKClassId(String attributeName, String type)

INTERNAL: We store these to validate the primary class when processing the entity class.

public void
addPrimaryKeyField(DatabaseField field)

INTERNAL: Add a field representing the primary key or part of a composite primary key to the List of primary key fields on the relational descriptor associated with this metadata descriptor.

public void
addPrimaryKeyField(DatabaseField field, MappingAccessor accessor)

INTERNAL: Add a field representing the primary key or part of a composite primary key to the List of primary key fields on the relational descriptor associated with this metadata descriptor.

public void
addProperty(PropertyMetadata property)

INTERNAL: Add a property to the descriptor.

public void
addRelationshipAccessor(RelationshipAccessor accessor)

INTERNAL: Store relationship accessors for later processing and quick look up.

public void
addTable(DatabaseTable table)

INTERNAL:

public void
clearMappingAccessors()

INTERNAL: This method is called only for canonical model generation during the pre-processing stage.

public boolean
public String
getAlias()

INTERNAL:

public AssociationOverrideMetadata
getAssociationOverrideFor(String attributeName)

INTERNAL:

public Collection<AssociationOverrideMetadata>
public AttributeOverrideMetadata
getAttributeOverrideFor(String attributeName)

INTERNAL:

public Collection<AttributeOverrideMetadata>
public MetadataAccessor
getBiDirectionalManyToManyAccessor(String className, String attributeName)

INTERNAL: Assumes hasBidirectionalManyToManyAccessorFor has been called before hand.

public Boolean

Returns:

Entity @Cacheable annotation value. This value refers to current class only and does not contain inherited value from parent classes.
getCacheable
()

INTERNAL: Get entity @Cacheable annotation value.

public ClassAccessor
getClassAccessor()

INTERNAL:

public ClassDescriptor
getClassDescriptor()

INTERNAL: Return the RelationalDescriptor instance associated with this MetadataDescriptor

public CMPPolicy
getCMPPolicy()

INTERNAL:

public List<ConvertMetadata>
getConverts(String attributeName)

INTERNAL:

public String
getDefaultAccess()

INTERNAL:

public AccessMethodsMetadata
public String
getDefaultCatalog()

INTERNAL:

public String
getDefaultSchema()

INTERNAL:

public String
getDefaultTableName()

INTERNAL: The default table name is the descriptor alias, unless this descriptor metadata is an inheritance subclass with a SINGLE_TABLE strategy.

public List<TenantDiscriminatorColumnMetadata>
public List<ObjectAccessor>
public EmbeddedIdAccessor
getEmbeddedIdAccessor()

INTERNAL: Return the embedded id accessor for this descriptor if one exists.

public String
public EntityAccessor
getEntityAccessor()

INTERNAL: This method assumes that by calling this method you are certain that the related class accessor to this descriptor is an EntityAccessor.

public DatabaseField
getField(String fieldName)

INTERNAL: Return the DatabaseField from the given field name from this descriptor.

public String
getGenericType(String genericName)

INTERNAL: Return the type from the generic name.

public Map<K, V>
getGenericTypes()

INTERNAL:

public Map<String, IdAccessor>
getIdAccessors()

INTERNAL:

public String
getIdAttributeName()

INTERNAL: Return the primary key attribute name for this entity.

public List<String>
getIdAttributeNames()

INTERNAL: Return the id attribute names declared on this descriptor metadata.

public List<String>
getIdOrderByAttributeNames()

INTERNAL: Return the primary key attribute names for this entity.

public MetadataDescriptor
getInheritanceParentDescriptor()

INTERNAL: Returns the immediate parent's descriptor in the inheritance hierarchy.

public MetadataDescriptor
getInheritanceRootDescriptor()

INTERNAL: Returns the root descriptor of the inheritance hierarchy, that is, the one that defines the inheritance strategy.

public MetadataClass
getJavaClass()

INTERNAL:

public String
getJavaClassName()

INTERNAL:

public MetadataLogger
getLogger()

INTERNAL:

public List<ConvertMetadata>
getMapKeyConverts(String attributeName)

INTERNAL:

public MappingAccessor
getMappingAccessor(String fieldOrPropertyName)

INTERNAL: This method will first check for an accessor with name equal to field or property name.

protected MappingAccessor
getMappingAccessor(String fieldOrPropertyName, boolean checkForMethodName)

INTERNAL: This method will first check for an accessor with name equal to field or property name.

public Collection<MappingAccessor>
getMappingAccessors()

INTERNAL: Return the collection of mapping accessors for this descriptor.

public DatabaseMapping
getMappingForAttributeName(String attributeName)

INTERNAL:

public List<DatabaseMapping>
getMappings()

INTERNAL:

public MetadataDescriptor
public List<String>
getOrderByAttributeNames()

INTERNAL: This will return the attribute names for all the direct to field mappings on this descriptor metadata.

public MetadataClass
getPKClass()

INTERNAL:

public Map<String, String>
getPKClassIDs()

INTERNAL:

public String
getPKClassName()

INTERNAL:

public MappingAccessor
getPrimaryKeyAccessorForField(DatabaseField field)

INTERNAL: Return the primary key mapping for the given field.

public DatabaseField
getPrimaryKeyField()

INTERNAL: Method to return the primary key field name this descriptor metadata.

public String
getPrimaryKeyFieldName()

INTERNAL: Method to return the primary key field name for this descriptor metadata.

public List<DatabaseField>
getPrimaryKeyFields()

INTERNAL Return the primary key fields for this descriptor metadata.

public DatabaseField
getPrimaryKeyJoinColumnAssociation(DatabaseField foreignKey)

INTERNAL: Recursively check the potential chaining of the primary key fields from a inheritance subclass, all the way to the root of the inheritance hierarchy.

public DatabaseField
getPrimaryKeyJoinColumnAssociationField(DatabaseField primaryKeyField)

INTERNAL: Returns the first primary key join column association if there is one.

public DatabaseTable
getPrimaryKeyTable()

INTERNAL: Assumes there is one primary key field set.

public DatabaseTable
getPrimaryTable()

INTERNAL:

public String
public MetadataProject
getProject()

INTERNAL:

protected ReturningPolicy
getReturningPolicy()

INTERNAL:

public DatabaseField
public Map<String, List<DatabaseField>>
getSingleTableMultitenantFields()

INTERNAL: Assumes a call to hasSingleTableMultitenant has been made before hand.

public boolean
hasAdditionalCriteria()

INTERNAL: Returns true is an additional criteria has been set on this descriptor's query manager.

public boolean
hasAssociationOverrideFor(String attributeName)

INTERNAL:

public boolean
hasAttributeOverrideFor(String attributeName)

INTERNAL:

public boolean
hasBiDirectionalManyToManyAccessorFor(String className, String attributeName)

INTERNAL:

public boolean
hasCache()

INTERNAL: Indicates that a Cache annotation or cache element has already been processed for this descriptor.

public boolean
hasCacheable()

INTERNAL: Indicates that a Cacheable annotation or cache element has already been processed for this descriptor.

public boolean
hasCacheInterceptor()

INTERNAL: Indicates that a CacheInterceptor annotation or cacheInterceptor element has already been processed for this descriptor.

public boolean
hasChangeTracking()

INTERNAL: Indicates that a Change tracking annotation or change tracking element has already been processed for this descriptor.

public boolean
public boolean
hasConverts(String attributeName)

INTERNAL: Return true if there is convert metadata for the given attribute name.

public boolean
hasCopyPolicy()

INTERNAL: Indicates that a copy Policy annotation or copy policy element has already been processed for this descriptor.

public boolean
hasCustomizer()

INTERNAL: Indicates that a customizer annotation or customizer element has already been processed for this descriptor.

public boolean
hasDefaultRedirectors()

INTERNAL: Indicates that a DefaultRedirectors annotation or default-redirectors element has already been processed for this descriptor.

public boolean
hasEmbeddedId()

INTERNAL:

public boolean
public boolean
hasIdAccessor()

INTERNAL: Return whether there is an IdAccessor on this descriptor.

public boolean
hasMapKeyConverts(String attributeName)

INTERNAL: Return true if there is map key convert metadata for the given attribute name.

public boolean
hasMappingAccessor(String attributeName)

INTERNAL: Returns true if we already have (processed) an accessor for the given attribute name.

public boolean
hasMappingForAttributeName(String attributeName)

INTERNAL:

public boolean
hasMultitenant()

INTERNAL: Indicates if multitenant metadata has been processed for this descriptor.

public boolean
hasPKClass()

INTERNAL:

public boolean
hasPrimaryKey()

INTERNAL: Indicates that a PrimaryKey annotation or primary-key element has been processed for this descriptor.

public boolean
hasPrimaryKeyFields()

INTERNAL: Return true is the descriptor has primary key fields set.

public boolean
hasReadOnly()

INTERNAL: Indicates that a read only annotation or read only element has already been processed for this descriptor.

public boolean
hasSingleTableMultitenant()

INTERNAL: Indicates if single table multitenant metadata has been processed for this descriptor.

public boolean
isCacheableFalse()

INTERNAL: Indicates that an explicit cacheable value of false has been set for this descriptor.

public boolean
isCacheableTrue()

INTERNAL: Indicates that an explicit cacheable value of true has been set for this descriptor.

public boolean
isCascadePersist()

INTERNAL: Indicates that cascade-persist should be applied to all relationship mappings for this entity.

public boolean
isEmbeddable()

INTERNAL:

public boolean
public boolean
public boolean
isMappedSuperclass()

INTERNAL: Return whether the ClassAccessor on this MetadataDescriptor is a MappedSuperclassAccessor.

public boolean
m_hasSerializedObjectPolicy()

INTERNAL: Indicates that a SerializedObject annotation or serialized-object element has been processed for this descriptor.

public boolean
public void
processMappingAccessors()

INTERNAL: Process this descriptors mapping accessors.

public void
removePrimaryKeyField(DatabaseField field)

INTERNAL: Remove the following field from the primary key field lists.

public void
setAccessTypeOnClassDescriptor(String accessType)

INTERNAL: Record whether this descriptor uses property access.

public void
setAlias(String alias)

INTERNAL:

public void
setCacheable(Boolean
Entity @Cacheable annotation value. This value refers to current class only and does not contain inherited value from parent classes.
cacheable
)

INTERNAL: Set entity @Cacheable annotation value.

public void
setCacheableInDescriptor()

INTERNAL: Pass entity @Cacheable annotation value to cache configuration object in class descriptor.

public void
setClassAccessor(ClassAccessor accessor)

INTERNAL:

public void
setDefaultAccess(String defaultAccess)

INTERNAL:

public void
setDefaultAccessMethods(AccessMethodsMetadata accessMethods)

INTERNAL: Default access methods can come from the following locations (in XML only) : - persistence-unit-defaults - entity-mappings - entity - embeddable Be default, the default access methods are set to use "get" and "set" unless they are overridden by discovering access methods specified at one of the locations above.

public void
setDefaultCatalog(String defaultCatalog)

INTERNAL:

public void
setDefaultSchema(String defaultSchema)

INTERNAL:

public void
public void
setDescriptor(ClassDescriptor descriptor)

INTERNAL: Set the RelationalDescriptor instance associated with this MetadataDescriptor

public void
setEmbeddedIdAccessor(EmbeddedIdAccessor embeddedIdAccessor)

INTERNAL:

public void
setEntityEventListener(EntityListener<T> listener)

INTERNAL:

public void
setExcludeDefaultListeners(boolean excludeDefaultListeners)

INTERNAL:

public void
setExcludeSuperclassListeners(boolean excludeSuperclassListeners)

INTERNAL:

public void
setExistenceChecking(String existenceChecking)

INTERNAL:

public void
setHasCache()

INTERNAL: Indicates that we have processed a cache annotation or cache xml element.

public void
setHasCacheInterceptor()

INTERNAL: Indicates that we have processed a cache annotation or cache xml element.

public void
setHasChangeTracking()

INTERNAL: Indicates that we have processed a change tracking annotation or change tracking xml element.

public void
setHasCopyPolicy()

INTERNAL: Indicates that we have processed a copy policy annotation or copy policy xml element.

public void
setHasCustomizer()

INTERNAL: Indicates that we have processed a customizer annotation or customizer xml element.

public void
setHasDefaultRedirectors()

INTERNAL: Indicates that we have processed a cache annotation or cache xml element.

public void
setHasPrimaryKey()

INTERNAL: Indicates that we have processed a PrimaryKey annotation or primary-key xml element.

public void
setHasSerializedObjectPolicy()

INTERNAL: Indicates that we have processed a serialized object annotation or serialized object xml element.

public void
setInheritanceParentDescriptor(MetadataDescriptor inheritanceParentDescriptor)

INTERNAL: Set the immediate parent's descriptor of the inheritance hierarchy.

public void
setInheritanceRootDescriptor(MetadataDescriptor inheritanceRootDescriptor)

INTERNAL: Set the root descriptor of the inheritance hierarchy, that is, the one that defines the inheritance strategy.

public void
setIsCascadePersist(boolean isCascadePersist)

INTERNAL: Indicates that cascade-persist should be added to the set of cascade values for all relationship mappings.

public void
setIsEmbeddable()

INTERNAL:

public void
setJavaClass(MetadataClass javaClass)

INTERNAL: Used to set this descriptors java class.

public void
public void
public void
setPKClass(MetadataClass pkClass)

INTERNAL:

public void
setPrimaryTable(DatabaseTable primaryTable)

INTERNAL:

public void
setReadOnly(boolean readOnly)

INTERNAL:

public void
public void
public void
setUsesCascadedOptimisticLocking(Boolean usesCascadedOptimisticLocking)

INTERNAL:

public String
toString()

Overrides java.lang.Object.toString.

INTERNAL:
public void
useNoCache()

INTERNAL:

public boolean
public boolean
usesDefaultPropertyAccess()

INTERNAL: Returns true if this class uses default property access.

public boolean
public boolean
usesSingleTableInheritanceStrategy()

INTERNAL: Indicates if the strategy on the descriptor's inheritance policy is SINGLE_TABLE.

public boolean
usesTablePerClassInheritanceStrategy()

INTERNAL: Return true if this descriptor uses a table per class inheritance policy.

public boolean
usesVersionColumnOptimisticLocking()

INTERNAL: Return true if this descriptors class processed OptimisticLocking meta data of type VERSION_COLUMN.

public void
validateDerivedPKClassId(String attributeName, String expectedType, String referenceClassName)

INTERNAL: This method is used to validate derived id fields only.

public void
validatePKClassId(String attributeName, String actualType)

INTERNAL: This method is used only to validate id fields that were found on a pk class were also found on the entity.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait