Module org.eclipse.persistence.jpa
Class MetadataAnnotatedElement
java.lang.Object
org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject
org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement
- Direct Known Subclasses:
MetadataClass
,MetadataField
,MetadataMethod
INTERNAL:
Parent object that is used to hold onto a valid JPA decorated method, field
or class.
- Since:
- EclipseLink 1.0
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject
m_factory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(MetadataAnnotation annotation) INTERNAL:void
addGenericType
(String genericType) INTERNAL:void
addMetaAnnotation
(MetadataAnnotation annotation) INTERNAL:boolean
areAnnotationsCompatibleWithTransient
(ClassAccessor classAccessor) INTERNAL: Return true if this accessible object has 2 or more declared persistence annotations.boolean
INTERNAL:getAnnotation
(Class<?> annotation) INTERNAL: Return the annotated element for this accessor.getAnnotation
(String annotation) INTERNAL: Return the annotated element for this accessor.protected final MetadataAnnotation
getAnnotation
(String annotation, Set<String> names) INTERNAL: Return the annotated element for this accessor.getAnnotation
(String annotationClassName, ClassAccessor classAccessor) INTERNAL: Return the annotated element for this accessor.INTERNAL: Return the annotations of this accessible object.INTERNAL:protected int
getDeclaredAnnotationsCount
(ClassAccessor classAccessor) INTERNAL:INTERNAL:getMapKeyClass
(MetadataDescriptor descriptor) INTERNAL: This should only be called for accessor's of type Map.int
INTERNAL:getName()
INTERNAL:INTERNAL: If this annotated element was built from java model elements and is a primitive type, this primitive type will be set.getRawClass
(MetadataDescriptor descriptor) INTERNAL: Return the raw class for this accessible object.getRawClassWithGenerics
(MetadataDescriptor descriptor) INTERNAL: Return the complete raw class with generics for this accessible object.getReferenceClassFromGeneric
(MetadataDescriptor descriptor) INTERNAL: Return the reference class from the generic specification on this accessible object.getType()
INTERNAL:boolean
hasDeclaredAnnotations
(ClassAccessor classAccessor) INTERNAL: Return true if this accessible object has 1 or more declared persistence annotations.int
hashCode()
INTERNAL:boolean
isAnnotationNotPresent
(Class<?> annotation, ClassAccessor accessor) INTERNAL: Indicates whether the specified annotation is actually not present on this accessible object.boolean
isAnnotationNotPresent
(String annotation, ClassAccessor accessor) INTERNAL: Indicates whether the specified annotation is actually not present on this accessible object.boolean
isAnnotationPresent
(Class<?> annotationClass, ClassAccessor accessor) INTERNAL: Indicates whether the specified annotation is present on java class for the given descriptor metadata.boolean
isAnnotationPresent
(String annotation) INTERNAL: Indicates whether the specified annotation is present on this accessible object.boolean
isAnnotationPresent
(String annotationName, ClassAccessor accessor) INTERNAL: Indicates whether the specified annotation is present on java class for the given descriptor metadata.boolean
isArray
(ClassAccessor classAccessor) INTERNAL: Return true if this field accessor represents an array relationship.boolean
isBasic
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents a basic mapping.boolean
isBasicCollection
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents a basic collection mapping.boolean
isBasicMap
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents a basic collection mapping.boolean
isDerivedId
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents an id mapping.boolean
isDerivedIdClass
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents an id mapping.boolean
isElementCollection
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents an element collection mapping.boolean
isEmbedded
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents an aggregate mapping.boolean
isEmbeddedId
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents an aggregate id mapping.boolean
INTERNAL: Method to return whether a collection type is a generic.boolean
INTERNAL: Method to return whether a type is a generic.boolean
isId
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents an id mapping.boolean
isManyToMany
(ClassAccessor classAccessor) INTERNAL: Return true if this field accessor represents a m-m relationship.boolean
isManyToOne
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents a m-1 relationship.boolean
isOneToMany
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents a 1-m relationship.boolean
isOneToOne
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents a 1-1 relationship.boolean
isStructure
(ClassAccessor classAccessor) INTERNAL: Return true if this field accessor represents a structure relationship.boolean
isSupportedCollectionClass
(MetadataClass metadataClass) INTERNAL: Method to return whether the given class is a supported collection class.boolean
isSupportedMapClass
(MetadataClass metadataClass) INTERNAL: Method to return whether the given class is a supported map class.boolean
isSupportedToManyCollectionClass
(MetadataClass metadataClass) INTERNAL: Method to return whether the given class is a supported to many collection class.boolean
isTransformation
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents an transformation mapping.protected boolean
isValidPersistenceElement
(boolean mustBeExplicit, String explicitType, ClassAccessor classAccessor) INTERNAL: When processing the inverse accessors to an explicit access setting, their must be an Access(FIELD) or Access(PROPERTY) present for the element to be processed.protected boolean
isValidPersistenceElement
(int modifiers) INTERNAL: Return true if the modifiers are not transient, static or abstract.boolean
isVariableOneToOne
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents a variable 1-1 relationship.boolean
isVersion
(ClassAccessor classAccessor) INTERNAL: Return true if this accessor represents a version mapping.void
setAnnotations
(Map<String, MetadataAnnotation> annotations) INTERNAL: Set the annotations of this accessible object.void
setAttributeName
(String attributeName) INTERNAL:void
setGenericType
(List<String> genericType) INTERNAL:void
setModifiers
(int modifiers) INTERNAL:void
INTERNAL:void
setPrimitiveType
(Object primitiveType) INTERNAL: If this annotated element was built from java model elements and is a primitive type this method will be called.void
INTERNAL:toString()
INTERNAL:Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAccessibleObject
getLogger, getMetadataClass, getMetadataFactory, setMetadataFactory
-
Field Details
-
DEFAULT_RAW_CLASS
- See Also:
-
-
Constructor Details
-
MetadataAnnotatedElement
INTERNAL:
-
-
Method Details
-
addAnnotation
INTERNAL: -
addMetaAnnotation
INTERNAL: -
addGenericType
INTERNAL: -
equals
INTERNAL: -
getAnnotation
INTERNAL: Return the annotated element for this accessor. Note: This method does not check against a metadata complete. -
getAnnotation
INTERNAL: Return the annotated element for this accessor. Note: This method does not check against a meta-data complete.- Parameters:
annotation
- annotation name
-
getAnnotation
INTERNAL: Return the annotated element for this accessor. Note: This method does not check against a meta-data complete.- Parameters:
annotation
- annotation namenames
- meta-annotations names cycle detection set, shall not benull
-
getAnnotation
INTERNAL: Return the annotated element for this accessor. -
getAnnotations
INTERNAL: Return the annotations of this accessible object.- Returns:
- annotations defined for the element, keyed by annotation name.
Never returns
null
.
-
getAttributeName
INTERNAL:- Specified by:
getAttributeName
in classMetadataAccessibleObject
-
getDeclaredAnnotationsCount
INTERNAL: -
getGenericType
INTERNAL: -
getMapKeyClass
INTERNAL: This should only be called for accessor's of type Map. It will return the map key type if generics are used, null otherwise. -
getModifiers
public int getModifiers()INTERNAL: -
getName
INTERNAL:- Specified by:
getName
in classMetadataAccessibleObject
-
getPrimitiveType
INTERNAL: If this annotated element was built from java model elements and is a primitive type, this primitive type will be set. -
getRawClass
INTERNAL: Return the raw class for this accessible object. E.g. For an accessible object with a type of java.util.Collection<Employee>, this method will return java.util.Collection.- See Also:
-
getRawClassWithGenerics
INTERNAL: Return the complete raw class with generics for this accessible object. E.g. For an accessible object with a type of java.util.Collection<Employee>, this method will return java.util.CollectionEmployee. Note, the generics are appended to the name of the class.- See Also:
-
getReferenceClassFromGeneric
INTERNAL: Return the reference class from the generic specification on this accessible object. Here is what you will get back from this method given the following scenarios: 1 - public Collection<String> getTasks() => String.class 2 - public Map<String, Integer> getTasks() => Integer.class 3 - public Employee getEmployee() => null 4 - public Collection getTasks() => null 5 - public Map getTasks() => null 6 - public Collection<byte[]> getAudio() => byte[].class 7 - public Map<X,Y> on a MappedSuperclass where Y is defined in the Entity superclass<T> => Void.class (in all bug 266912 cases) -
getType
INTERNAL: -
hasDeclaredAnnotations
INTERNAL: Return true if this accessible object has 1 or more declared persistence annotations. -
hashCode
public int hashCode()INTERNAL: -
areAnnotationsCompatibleWithTransient
INTERNAL: Return true if this accessible object has 2 or more declared persistence annotations. -
isAnnotationNotPresent
INTERNAL: Indicates whether the specified annotation is actually not present on this accessible object. Used for defaulting. Need this check since the isAnnotationPresent calls can return a false when true because of the meta-data complete feature. -
isAnnotationNotPresent
INTERNAL: Indicates whether the specified annotation is actually not present on this accessible object. Used for defaulting. Need this check since the isAnnotationPresent calls can return a false when true because of the meta-data complete feature. -
isAnnotationPresent
INTERNAL: Indicates whether the specified annotation is present on java class for the given descriptor metadata. -
isAnnotationPresent
INTERNAL: Indicates whether the specified annotation is present on this accessible object. NOTE: Calling this method directly does not take any metadata complete flag into consideration. Look at the other isAnnotationPresent methods that takes a class accessor. -
isAnnotationPresent
INTERNAL: Indicates whether the specified annotation is present on java class for the given descriptor metadata. -
isArray
INTERNAL: Return true if this field accessor represents an array relationship. -
isBasic
INTERNAL: Return true if this accessor represents a basic mapping. -
isBasicCollection
INTERNAL: Return true if this accessor represents a basic collection mapping. -
isBasicMap
INTERNAL: Return true if this accessor represents a basic collection mapping. -
isDerivedId
INTERNAL: Return true if this accessor represents an id mapping. -
isDerivedIdClass
INTERNAL: Return true if this accessor represents an id mapping. -
isElementCollection
INTERNAL: Return true if this accessor represents an element collection mapping. -
isEmbedded
INTERNAL: Return true if this accessor represents an aggregate mapping. True is returned if an Embedded annotation is found or if an Embeddable annotation is found on the raw/reference class. -
isEmbeddedId
INTERNAL: Return true if this accessor represents an aggregate id mapping. -
isGenericCollectionType
public boolean isGenericCollectionType()INTERNAL: Method to return whether a collection type is a generic. -
isGenericType
public boolean isGenericType()INTERNAL: Method to return whether a type is a generic. -
isId
INTERNAL: Return true if this accessor represents an id mapping. -
isManyToMany
INTERNAL: Return true if this field accessor represents a m-m relationship. -
isManyToOne
INTERNAL: Return true if this accessor represents a m-1 relationship. -
isOneToMany
INTERNAL: Return true if this accessor represents a 1-m relationship. -
isOneToOne
INTERNAL: Return true if this accessor represents a 1-1 relationship. -
isStructure
INTERNAL: Return true if this field accessor represents a structure relationship. -
isSupportedCollectionClass
INTERNAL: Method to return whether the given class is a supported collection class. -
isSupportedMapClass
INTERNAL: Method to return whether the given class is a supported map class. -
isSupportedToManyCollectionClass
INTERNAL: Method to return whether the given class is a supported to many collection class. -
isTransformation
INTERNAL: Return true if this accessor represents an transformation mapping. -
isValidPersistenceElement
protected boolean isValidPersistenceElement(boolean mustBeExplicit, String explicitType, ClassAccessor classAccessor) INTERNAL: When processing the inverse accessors to an explicit access setting, their must be an Access(FIELD) or Access(PROPERTY) present for the element to be processed. Otherwise, it is ignored. -
isValidPersistenceElement
protected boolean isValidPersistenceElement(int modifiers) INTERNAL: Return true if the modifiers are not transient, static or abstract. -
isVariableOneToOne
INTERNAL: Return true if this accessor represents a variable 1-1 relationship. The method will return true if one of the following conditions is met: - There is a VariableOneToOne annotation present, or - The raw class is an interface and not a collection or map, nor a ValueHolderInterface (and an exclude default mappings flag is not set) -
isVersion
INTERNAL: Return true if this accessor represents a version mapping. -
setAnnotations
INTERNAL: Set the annotations of this accessible object. -
setAttributeName
INTERNAL: -
setGenericType
INTERNAL: -
setModifiers
public void setModifiers(int modifiers) INTERNAL: -
setName
INTERNAL: -
setPrimitiveType
INTERNAL: If this annotated element was built from java model elements and is a primitive type this method will be called. -
setType
INTERNAL: -
toString
INTERNAL:
-