org.hibernate.cfg
Class AnnotationBinder

java.lang.Object
  extended by org.hibernate.cfg.AnnotationBinder

public final class AnnotationBinder
extends Object

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)

Author:
Emmanuel Bernard, Hardy Ferentschik

Method Summary
static void bindClass(org.hibernate.annotations.common.reflection.XClass clazzToProcess, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass, ExtendedMappings mappings)
          Bind a class having JSR175 annotations.
static void bindDefaults(ExtendedMappings mappings)
           
static void bindPackage(String packageName, ExtendedMappings mappings)
           
static Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> buildInheritanceStates(List<org.hibernate.annotations.common.reflection.XClass> orderedClasses, ExtendedMappings mappings)
          For the mapped entities build some temporary data-structure containing information about the inheritance status of a class.
static Component createComponent(PropertyHolder propertyHolder, PropertyData inferredData, boolean isComponentEmbedded, boolean isIdentifierMapper)
           
protected static void defineFetchingStrategy(ToOne toOne, org.hibernate.annotations.common.reflection.XProperty property)
           
static Component fillComponent(PropertyHolder propertyHolder, PropertyData inferredData, AccessType propertyAccessor, boolean isNullable, EntityBinder entityBinder, boolean isComponentEmbedded, boolean isIdentifierMapper, boolean inSecondPass, ExtendedMappings mappings, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)
           
static Component fillComponent(PropertyHolder propertyHolder, PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, boolean isNullable, EntityBinder entityBinder, boolean isComponentEmbedded, boolean isIdentifierMapper, boolean inSecondPass, ExtendedMappings mappings, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)
           
static FetchMode getFetchMode(FetchType fetch)
           
static boolean isDefault(org.hibernate.annotations.common.reflection.XClass clazz, ExtendedMappings mappings)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bindDefaults

public static void bindDefaults(ExtendedMappings mappings)

bindPackage

public static void bindPackage(String packageName,
                               ExtendedMappings mappings)

bindClass

public static void bindClass(org.hibernate.annotations.common.reflection.XClass clazzToProcess,
                             Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass,
                             ExtendedMappings mappings)
                      throws MappingException
Bind a class having JSR175 annotations. Subclasses have to be bound after its parent class.

Parameters:
clazzToProcess - entity to bind as XClass instance
inheritanceStatePerClass - Meta data about the inheritance relationships for all mapped classes
mappings - Mapping meta data
Throws:
MappingException - in case there is an configuration error

fillComponent

public static Component fillComponent(PropertyHolder propertyHolder,
                                      PropertyData inferredData,
                                      AccessType propertyAccessor,
                                      boolean isNullable,
                                      EntityBinder entityBinder,
                                      boolean isComponentEmbedded,
                                      boolean isIdentifierMapper,
                                      boolean inSecondPass,
                                      ExtendedMappings mappings,
                                      Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)

fillComponent

public static Component fillComponent(PropertyHolder propertyHolder,
                                      PropertyData inferredData,
                                      PropertyData baseInferredData,
                                      AccessType propertyAccessor,
                                      boolean isNullable,
                                      EntityBinder entityBinder,
                                      boolean isComponentEmbedded,
                                      boolean isIdentifierMapper,
                                      boolean inSecondPass,
                                      ExtendedMappings mappings,
                                      Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)

createComponent

public static Component createComponent(PropertyHolder propertyHolder,
                                        PropertyData inferredData,
                                        boolean isComponentEmbedded,
                                        boolean isIdentifierMapper)

defineFetchingStrategy

protected static void defineFetchingStrategy(ToOne toOne,
                                             org.hibernate.annotations.common.reflection.XProperty property)

getFetchMode

public static FetchMode getFetchMode(FetchType fetch)

isDefault

public static boolean isDefault(org.hibernate.annotations.common.reflection.XClass clazz,
                                ExtendedMappings mappings)

buildInheritanceStates

public static Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> buildInheritanceStates(List<org.hibernate.annotations.common.reflection.XClass> orderedClasses,
                                                                                                              ExtendedMappings mappings)
For the mapped entities build some temporary data-structure containing information about the inheritance status of a class.

Parameters:
orderedClasses - Order list of all annotated entities and their mapped superclasses
Returns:
A map of InheritanceStates keyed against their XClass.


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.