Top Description Inners Fields Constructors Methods
org.hibernate.cfg

public final Class AnnotationBinder

extends Object
Class Inheritance
Annotations
@SuppressWarnings:unchecked
Imports
java.lang.annotation.Annotation, java.util.ArrayList, .Arrays, .Collection, .EnumSet, .HashMap, .HashSet, .Iterator, .List, .Map, .Properties, .Set, javax.persistence.Basic, .Cacheable, .CollectionTable, .Column, .DiscriminatorType, .DiscriminatorValue, .ElementCollection, .Embeddable, .Embedded, .EmbeddedId, .Entity, .FetchType, .GeneratedValue, .GenerationType, .Id, .IdClass, .InheritanceType, .JoinColumn, .JoinTable, .ManyToMany, .ManyToOne, .MapKey, .MapKeyColumn, .MapKeyJoinColumn, .MapKeyJoinColumns, .MappedSuperclass, .MapsId, .NamedNativeQueries, .NamedNativeQuery, .NamedQueries, .NamedQuery, .OneToMany, .OneToOne, .OrderColumn, .PrimaryKeyJoinColumn, .PrimaryKeyJoinColumns, .SequenceGenerator, .SharedCacheMode, .SqlResultSetMapping, .SqlResultSetMappings, .Table, .TableGenerator, .UniqueConstraint, .Version, org.slf4j.Logger, .LoggerFactory, org.hibernate.AnnotationException, .AssertionFailure, .EntityMode, .FetchMode, .MappingException, org.hibernate.annotations.BatchSize, .Cache, .CacheConcurrencyStrategy, .Cascade, .CascadeType, .Check, .CollectionId, .CollectionOfElements, .Columns, .DiscriminatorOptions, .Fetch, .FetchProfile, .FetchProfiles, .Filter, .FilterDef, .FilterDefs, .Filters, .ForceDiscriminator, .ForeignKey, .Formula, .GenericGenerator, .GenericGenerators, .Index, .LazyToOne, .LazyToOneOption, .ManyToAny, .MapKeyType, .NaturalId, .NotFound, .NotFoundAction, .OnDelete, .OnDeleteAction, .OrderBy, .ParamDef, .Parameter, .Parent, .Proxy, .Sort, .Source, .Tuplizer, .Tuplizers, .TypeDef, .TypeDefs, .Where, org.hibernate.annotations.common.reflection.ReflectionManager, .XAnnotatedElement, .XClass, .XMethod, .XPackage, .XProperty, org.hibernate.cache.RegionFactory, org.hibernate.cfg.annotations.CollectionBinder, .EntityBinder, .MapKeyColumnDelegator, .MapKeyJoinColumnDelegator, .Nullability, .PropertyBinder, .QueryBinder, .SimpleValueBinder, .TableBinder, org.hibernate.engine.FilterDefinition, .Versioning, org.hibernate.id.MultipleHiLoPerTableGenerator, .PersistentIdentifierGenerator, .SequenceHiLoGenerator, .TableHiLoGenerator, org.hibernate.id.enhanced.SequenceStyleGenerator, org.hibernate.mapping.Any, .Component, .DependantValue, .IdGenerator, .Join, .JoinedSubclass, .KeyValue, .PersistentClass, .Property, .RootClass, .SimpleValue, .SingleTableSubclass, .Subclass, .ToOne, .UnionSubclass, org.hibernate.persister.entity.JoinedSubclassEntityPersister, .SingleTableEntityPersister, .UnionSubclassEntityPersister

JSR 175 annotation binder which reads the annotations from classes, applies the principles of the EJB3 spec and produces the Hibernate configuration-time metamodel (the classes in the org.hibernate.mapping package)
Authors
Emmanuel Bernard, Hardy Ferentschik

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static CacheConcurrencyStrategy
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static int

Returns:

the number of id properties found while iterating the elements of annotatedClass using the determined access strategy, false otherwise.
addElementsOfClass
(List<PropertyData>
List of ProperyData instances
elements
,
AccessType
The default value access strategy which has to be used in case no explicit local access strategy is used
defaultAccessType
,
PropertyContainer
Metadata about a class and its properties
propertyContainer
,
Mappings
Mapping meta data
mappings
)

private static int
addProperty(PropertyContainer propertyContainer, XProperty property, List<PropertyData> annElts, String propertyAccessor, Mappings mappings)

private static void
bindAny(String cascadeStrategy, Ejb3JoinColumn[] columns, boolean cascadeOnDelete, Nullability nullability, PropertyHolder propertyHolder, PropertyData inferredData, EntityBinder entityBinder, boolean isIdentifierMapper, Mappings mappings)

public static void
bindClass(XClass
entity to bind as XClass instance
clazzToProcess
,
Map<XClass, InheritanceState>
Meta data about the inheritance relationships for all mapped classes
inheritanceStatePerClass
,
Mappings
Mapping meta data
mappings
)

Bind a class having JSR175 annotations.

private static PropertyBinder
bindComponent(PropertyData inferredData, PropertyHolder propertyHolder, AccessType propertyAccessor, EntityBinder entityBinder, boolean isIdentifierMapper, Mappings mappings, boolean isComponentEmbedded, boolean isId, Map<XClass, InheritanceState> inheritanceStatePerClass, String referencedEntityName, Ejb3JoinColumn[] columns)

public static void
private static void
bindDiscriminatorToPersistentClass(RootClass rootClass, Ejb3DiscriminatorColumn discriminatorColumn, Map<String, Join> secondaryTables, PropertyHolder propertyHolder, Mappings mappings)

private static void
bindFetchProfile(FetchProfile fetchProfileAnnotation, Mappings mappings)

private static void
bindFetchProfiles(XAnnotatedElement annotatedElement, Mappings mappings)

private static void
bindFilterDef(FilterDef defAnn, Mappings mappings)

private static void
bindFilterDefs(XAnnotatedElement annotatedElement, Mappings mappings)

private static void
bindFilters(XClass annotatedClass, EntityBinder entityBinder, Mappings mappings)

private static void
bindFilters(XAnnotatedElement annotatedElement, EntityBinder entityBinder)

private static void
private static void
bindGenericGenerators(XAnnotatedElement annotatedElement, Mappings mappings)

private static void
bindIdClass(String generatorType, String generatorName, PropertyData inferredData, PropertyData baseInferredData, Ejb3Column[] columns, PropertyHolder propertyHolder, boolean isComposite, AccessType propertyAccessor, EntityBinder entityBinder, boolean isEmbedded, boolean isIdentifierMapper, Mappings mappings, Map<XClass, InheritanceState> inheritanceStatePerClass)

private static void
bindJoinedTableAssociation(XProperty property, Mappings mappings, EntityBinder entityBinder, CollectionBinder collectionBinder, PropertyHolder propertyHolder, PropertyData inferredData, String mappedBy)

private static void
bindManyToOne(String cascadeStrategy, Ejb3JoinColumn[] columns, boolean optional, boolean ignoreNotFound, boolean cascadeOnDelete, XClass targetEntity, PropertyHolder propertyHolder, PropertyData inferredData, boolean unique, boolean isIdentifierMapper, boolean inSecondPass, PropertyBinder propertyBinder, Mappings mappings)

private static void
bindOneToOne(String cascadeStrategy, Ejb3JoinColumn[] joinColumns, boolean optional, FetchMode fetchMode, boolean ignoreNotFound, boolean cascadeOnDelete, XClass targetEntity, PropertyHolder propertyHolder, PropertyData inferredData, String mappedBy, boolean trueOneToOne, boolean isIdentifierMapper, boolean inSecondPass, PropertyBinder propertyBinder, Mappings mappings)

public static void
bindPackage(String packageName, Mappings mappings)

private static void
bindQueries(XAnnotatedElement annotatedElement, Mappings mappings)

private static void
bindTypeDef(TypeDef defAnn, Mappings mappings)

private static void
bindTypeDefs(XAnnotatedElement annotatedElement, Mappings mappings)

private static Cache
buildCacheMock(String region, Mappings mappings)

private static IdGenerator
public static Map<XClass, InheritanceState>

Returns:

A map of InheritanceStates keyed against their XClass.
buildInheritanceStates
(List<XClass>
Order list of all annotated entities and their mapped superclasses
orderedClasses
,
Mappings mappings)

For the mapped entities build some temporary data-structure containing information about the inheritance status of a class.

private static HashMap<String, IdGenerator>
private static EnumSet<CascadeType>
public static Component
createComponent(PropertyHolder propertyHolder, PropertyData inferredData, boolean isComponentEmbedded, boolean isIdentifierMapper, Mappings mappings)

protected static void
private static CacheConcurrencyStrategy
private static Cache
determineCacheSettings(XClass clazzToProcess, Mappings mappings)

private static SharedCacheMode
public static Component
fillComponent(PropertyHolder propertyHolder, PropertyData inferredData, AccessType propertyAccessor, boolean isNullable, EntityBinder entityBinder, boolean isComponentEmbedded, boolean isIdentifierMapper, boolean inSecondPass, Mappings mappings, Map<XClass, InheritanceState> inheritanceStatePerClass)

public static Component
fillComponent(PropertyHolder propertyHolder, PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, boolean isNullable, EntityBinder entityBinder, boolean isComponentEmbedded, boolean isIdentifierMapper, boolean inSecondPass, Mappings mappings, Map<XClass, InheritanceState> inheritanceStatePerClass)

private static String
generatorType(GenerationType generatorEnum, Mappings mappings)

private static String
getCascadeStrategy(CascadeType[] ejbCascades, Cascade hibernateCascadeAnnotation, boolean orphanRemoval, boolean forcePersist)

public static FetchMode
private static PersistentClass
getSuperEntity(XClass clazzToProcess, Map<XClass, InheritanceState> inheritanceStatePerClass, Mappings mappings, InheritanceState inheritanceState)

private static PropertyData
getUniqueIdPropertyFromBaseClass(PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, Mappings mappings)

private static boolean
public static boolean
isDefault(XClass clazz, Mappings mappings)

private static boolean
isEntityClassType(XClass clazzToProcess, AnnotatedClassType classType)

private static boolean
isIdClassPkOfTheAssociatedEntity(InheritanceState.ElementsToProcess elementsToProcess, XClass compositeClass, PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, Map<XClass, InheritanceState> inheritanceStatePerClass, Mappings mappings)

private static Ejb3JoinColumn[]
makeInheritanceJoinColumns(XClass clazzToProcess, Mappings mappings, InheritanceState inheritanceState, PersistentClass superEntity)

private static PersistentClass
makePersistentClass(InheritanceState inheritanceState, PersistentClass superEntity)

private static boolean
mapAsIdClass(Map<XClass, InheritanceState> inheritanceStatePerClass, InheritanceState inheritanceState, PersistentClass persistentClass, EntityBinder entityBinder, PropertyHolder propertyHolder, InheritanceState.ElementsToProcess elementsToProcess, Set<String> idPropertiesIfIdClass, Mappings mappings)

pack-priv static void
private static Ejb3DiscriminatorColumn
processDiscriminatorProperties(XClass clazzToProcess, Mappings mappings, InheritanceState inheritanceState, EntityBinder entityBinder)

private static void
processElementAnnotations(PropertyHolder propertyHolder, Nullability nullability, PropertyData inferredData, HashMap<String, IdGenerator> classGenerators, EntityBinder entityBinder, boolean isIdentifierMapper, boolean isComponentEmbedded, boolean inSecondPass, Mappings mappings, Map<XClass, InheritanceState> inheritanceStatePerClass)

private static void
processId(PropertyHolder propertyHolder, PropertyData inferredData, SimpleValue idValue, HashMap<String, IdGenerator> classGenerators, boolean isIdentifierMapper, Mappings mappings)

private static void
processIdPropertiesIfNotAlready(Map<XClass, InheritanceState> inheritanceStatePerClass, Mappings mappings, PersistentClass persistentClass, EntityBinder entityBinder, PropertyHolder propertyHolder, HashMap<String, IdGenerator> classGenerators, InheritanceState.ElementsToProcess elementsToProcess, boolean subclassAndSingleTableStrategy, Set<String> idPropertiesIfIdClass)

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