Top Description Inners Fields Constructors Methods
org.hibernate.cfg.annotations.reflection

public Class JPAOverridenAnnotationReader

extends Object
implements AnnotationReader
Class Inheritance
All Implemented Interfaces
org.hibernate.annotations.common.reflection.AnnotationReader
Annotations
@SuppressWarnings:unchecked
Imports
java.beans.Introspector, java.lang.annotation.Annotation, java.lang.reflect.AccessibleObject, .AnnotatedElement, .Field, .Method, java.util.ArrayList, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, javax.persistence.Access, .AccessType, .AssociationOverride, .AssociationOverrides, .AttributeOverride, .AttributeOverrides, .Basic, .CascadeType, .CollectionTable, .Column, .ColumnResult, .DiscriminatorColumn, .DiscriminatorType, .DiscriminatorValue, .ElementCollection, .Embeddable, .Embedded, .EmbeddedId, .Entity, .EntityListeners, .EntityResult, .EnumType, .Enumerated, .ExcludeDefaultListeners, .ExcludeSuperclassListeners, .FetchType, .FieldResult, .GeneratedValue, .GenerationType, .Id, .IdClass, .Inheritance, .InheritanceType, .JoinColumn, .JoinColumns, .JoinTable, .Lob, .ManyToMany, .ManyToOne, .MapKey, .MapKeyClass, .MapKeyColumn, .MapKeyEnumerated, .MapKeyJoinColumn, .MapKeyJoinColumns, .MapKeyTemporal, .MappedSuperclass, .MapsId, .NamedNativeQueries, .NamedNativeQuery, .NamedQueries, .NamedQuery, .OneToMany, .OneToOne, .OrderBy, .OrderColumn, .PostLoad, .PostPersist, .PostRemove, .PostUpdate, .PrePersist, .PreRemove, .PreUpdate, .PrimaryKeyJoinColumn, .PrimaryKeyJoinColumns, .QueryHint, .SecondaryTable, .SecondaryTables, .SequenceGenerator, .SqlResultSetMapping, .SqlResultSetMappings, .Table, .TableGenerator, .Temporal, .TemporalType, .Transient, .UniqueConstraint, .Version, org.dom4j.Attribute, .Element, org.slf4j.Logger, .LoggerFactory, org.hibernate.AnnotationException, org.hibernate.annotations.Cascade, .CollectionOfElements, .Columns, org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor, .AnnotationFactory, org.hibernate.annotations.common.reflection.AnnotationReader, .Filter, .ReflectionUtil, org.hibernate.util.ReflectHelper, .StringHelper

Encapsulates the overriding of Java annotations from an EJB 3.0 descriptor.
Authors
Paolo Perrotta, Davide Marchignoli, Emmanuel Bernard, Hardy Ferentschik

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private transient Annotation[]
private transient Map<Class<T>, Annotation>
private static final Map<Class<T>, String>
private String
private final AnnotatedElement
private transient List<Element>
private static final Filter
private Logger
private AccessibleObject
private String
private JPAOverridenAnnotationReader.PropertyType
private static final String
private static final String
private XMLContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
private Annotation

Returns:

The annotation which was added to the list or null.
addIfNotNull
(List<Annotation>
The list of annotations.
annotationList
,
Annotation
The annotation to add to the list.
annotation
)

Adds annotation to the list (only if it's not null) and then returns it.

private void
private void
private void
private void
private List<AssociationOverride>
private List<AttributeOverride>
private List<AttributeOverride>
buildAttributeOverrides(List<Element> subelements, String nodeName)

private Columns
private GeneratedValue
private void
buildJoinColumns(List<Annotation> annotationList, Element element)

private JoinTable
private void
buildMapKeyJoinColumns(List<Annotation> annotationList, Element element)

public static List<E>
buildNamedQueries(Element element, boolean isNative, XMLContext.Default defaults)

private PrimaryKeyJoinColumn[]
public static SequenceGenerator
public static List<SqlResultSetMapping>
public static TableGenerator
private static void
private void
private static void
copyBooleanAttribute(AnnotationDescriptor descriptor, Element element, String attribute)

private static void
copyIntegerAttribute(AnnotationDescriptor annotation, Element element, String attributeName)

private static void
copyStringAttribute(AnnotationDescriptor annotation, Element element, String attributeName, boolean mandatory)

private static void
copyStringElement(Element element, AnnotationDescriptor ad, String annotationAttribute)

private void
getAccessType(List<Annotation> annotationList, Element element)

private Access
public <T extends Annotation> T
public Annotation[]
private void
getAssociation(Class<? extends Annotation> annotationType, List<Annotation> annotationList, XMLContext.Default defaults)

As per section 12.2 of the JPA 2.0 specification, the association subelements (many-to-one, one-to-many, one-to-one, many-to-many, element-collection) completely override the mapping for the specified field or property.

private void
getAssociationId(List<Annotation> annotationList, Element element)

Adds an @Id annotation to the specified annotationList if the specified element has the id attribute set to true.

private AssociationOverrides
getAssociationOverrides(Element tree, XMLContext.Default defaults, boolean
Whether to use Java annotations for this element, if present and not disabled by the XMLContext defaults. In some contexts (such as an element-collection mapping) merging with annotations is never allowed.
mergeWithAnnotations
)

private AttributeOverrides
getAttributeOverrides(Element tree, XMLContext.Default defaults, boolean
Whether to use Java annotations for this element, if present and not disabled by the XMLContext defaults. In some contexts (such as an association mapping) merging with annotations is never allowed.
mergeWithAnnotations
)

private void
getBasic(List<Annotation> annotationList, XMLContext.Default defaults)

private void
private void
getCollectionTable(List<Annotation> annotationList, Element element, XMLContext.Default defaults)

private Column
getColumn(Element element, boolean isMandatory, Element current)

private DiscriminatorColumn
private DiscriminatorValue
private void
getElementCollection(List<Annotation> annotationList, XMLContext.Default defaults)

As per sections 12.2.3.23.9, 12.2.4.8.9 and 12.2.5.3.6 of the JPA 2.0 specification, the element-collection subelement completely overrides the mapping for the specified field or property.

private Embeddable
private void
getEmbedded(List<Annotation> annotationList, XMLContext.Default defaults)

private void
getEmbeddedId(List<Annotation> annotationList, XMLContext.Default defaults)

private Entity
private EntityListeners
private void
getEnumerated(List<Annotation> annotationList, Element element)

private ExcludeDefaultListeners
private ExcludeSuperclassListeners
private void
private void
getId(List<Annotation> annotationList, XMLContext.Default defaults)

private IdClass
private Inheritance
private <T extends Annotation> T
getJavaAnnotation(Class<T> annotationType)

private Annotation[]
private static String
private JoinColumn[]
getJoinColumns(Element element, boolean isInverse)

private void
getJoinTable(List<Annotation> annotationList, Element tree, XMLContext.Default defaults)

private void
getLob(List<Annotation> annotationList, Element element)

private void
getMapKey(List<Annotation> annotationList, Element element)

private AttributeOverrides
private void
getMapKeyClass(List<Annotation> annotationList, Element element, XMLContext.Default defaults)

private void
getMapKeyColumn(List<Annotation> annotationList, Element element)

private void
getMapKeyEnumerated(List<Annotation> annotationList, Element element)

Adds a @MapKeyEnumerated annotation to the specified annotationList if the specified element contains a map-key-enumerated sub-element.

private MapKeyJoinColumn[]
private void
getMapKeyTemporal(List<Annotation> annotationList, Element element)

Adds a @MapKeyTemporal annotation to the specified annotationList if the specified element contains a map-key-temporal sub-element.

private MappedSuperclass
private void
getMapsId(List<Annotation> annotationList, Element element)

Adds a @MapsId annotation to the specified annotationList if the specified element has the maps-id attribute set.

private Annotation
getMarkerAnnotation(Class<? extends Annotation> clazz, Element element, XMLContext.Default defaults)

private NamedNativeQueries
private NamedQueries
private void
getOrderBy(List<Annotation> annotationList, Element element)

private void
getOrderColumn(List<Annotation> annotationList, Element element)

Adds an @OrderColumn annotation to the specified annotationList if the specified element contains an order-column sub-element.

private PrimaryKeyJoinColumns
getPrimaryKeyJoinColumns(Element element, XMLContext.Default defaults, boolean
Whether to use Java annotations for this element, if present and not disabled by the XMLContext defaults. In some contexts (such as an association mapping) merging with annotations is never allowed.
mergeWithAnnotations
)

private SecondaryTables
private Annotation
getSequenceGenerator(List<Element> elementsForProperty, XMLContext.Default defaults)

private SequenceGenerator
private SqlResultSetMappings
private Table
private Annotation
getTableGenerator(List<Element> elementsForProperty, XMLContext.Default defaults)

private TableGenerator
private void
getTemporal(List<Annotation> annotationList, Element element)

private Transient
private void
getVersion(List<Annotation> annotationList, XMLContext.Default defaults)

private void
public <T extends Annotation> boolean
private <T extends Annotation> boolean
isJavaAnnotationPresent(Class<T> annotationType)

private boolean
private AttributeOverrides
mergeAttributeOverrides(XMLContext.Default defaults, List<AttributeOverride> attributes, boolean
Whether to use Java annotations for this element, if present and not disabled by the XMLContext defaults. In some contexts (such as an association mapping) merging with annotations is never allowed.
mergeWithAnnotations
)

private void
private JoinTable
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait