Class AnnotationBinder
- java.lang.Object
-
- org.hibernate.boot.model.internal.AnnotationBinder
-
public final class AnnotationBinder extends Object
Reads annotations from Java classes and produces the Hibernate configuration-time metamodel, that is, the objects defined in the packageorg.hibernate.mapping.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbindClass(org.hibernate.annotations.common.reflection.XClass annotatedClass, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass, MetadataBuildingContext context)Bind an annotated class.static voidbindDefaults(MetadataBuildingContext context)static voidbindFetchProfilesForClass(org.hibernate.annotations.common.reflection.XClass annotatedClass, MetadataBuildingContext context)static voidbindFetchProfilesForPackage(ClassLoaderService cls, String packageName, MetadataBuildingContext context)static voidbindFilterDefs(org.hibernate.annotations.common.reflection.XAnnotatedElement annotatedElement, MetadataBuildingContext context)static voidbindPackage(ClassLoaderService cls, String packageName, MetadataBuildingContext context)static voidbindQueries(org.hibernate.annotations.common.reflection.XAnnotatedElement annotatedElement, MetadataBuildingContext context)static Map<String,IdentifierGeneratorDefinition>buildGenerators(org.hibernate.annotations.common.reflection.XAnnotatedElement annotatedElement, MetadataBuildingContext context)static Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState>buildInheritanceStates(List<org.hibernate.annotations.common.reflection.XClass> orderedClasses, MetadataBuildingContext buildingContext)For the mapped entities build some temporary data-structure containing information about the inheritance status of a class.static ComponentcreateComponent(PropertyHolder propertyHolder, PropertyData inferredData, boolean isComponentEmbedded, boolean isIdentifierMapper, Class<? extends EmbeddableInstantiator> customInstantiatorImpl, MetadataBuildingContext context)static ComponentfillComponent(PropertyHolder propertyHolder, PropertyData inferredData, AccessType propertyAccessor, boolean isNullable, EntityBinder entityBinder, boolean isComponentEmbedded, boolean isIdentifierMapper, boolean inSecondPass, Class<? extends EmbeddableInstantiator> customInstantiatorImpl, Class<? extends CompositeUserType<?>> compositeUserTypeClass, AnnotatedColumns columns, MetadataBuildingContext context, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)static ComponentfillComponent(PropertyHolder propertyHolder, PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, boolean isNullable, EntityBinder entityBinder, boolean isComponentEmbedded, boolean isIdentifierMapper, boolean inSecondPass, Class<? extends EmbeddableInstantiator> customInstantiatorImpl, Class<? extends CompositeUserType<?>> compositeUserTypeClass, AnnotatedColumns columns, MetadataBuildingContext context, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)static StringgeneratorType(jakarta.persistence.GeneratedValue generatedValue, org.hibernate.annotations.common.reflection.XClass javaClass, MetadataBuildingContext context)static PropertyDatagetUniqueIdPropertyFromBaseClass(PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, MetadataBuildingContext context)static booleanisDefault(org.hibernate.annotations.common.reflection.XClass clazz, MetadataBuildingContext context)static voidprocessElementAnnotations(PropertyHolder propertyHolder, Nullability nullability, PropertyData inferredData, Map<String,IdentifierGeneratorDefinition> classGenerators, EntityBinder entityBinder, boolean isIdentifierMapper, boolean isComponentEmbedded, boolean inSecondPass, MetadataBuildingContext context, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)Process annotation of a particular property or field.static Constructor<?>resolveInstantiator(org.hibernate.annotations.common.reflection.XClass embeddableClass, MetadataBuildingContext buildingContext)
-
-
-
Method Detail
-
bindDefaults
public static void bindDefaults(MetadataBuildingContext context)
-
bindPackage
public static void bindPackage(ClassLoaderService cls, String packageName, MetadataBuildingContext context)
-
bindQueries
public static void bindQueries(org.hibernate.annotations.common.reflection.XAnnotatedElement annotatedElement, MetadataBuildingContext context)
-
bindClass
public static void bindClass(org.hibernate.annotations.common.reflection.XClass annotatedClass, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass, MetadataBuildingContext context) throws MappingExceptionBind an annotated class. A subclass must be bound after its superclass.- Parameters:
annotatedClass- entity to bind asXClassinstanceinheritanceStatePerClass- Metadata about the inheritance relationships for all mapped classes- Throws:
MappingException- in case there is a configuration error
-
bindFilterDefs
public static void bindFilterDefs(org.hibernate.annotations.common.reflection.XAnnotatedElement annotatedElement, MetadataBuildingContext context)
-
bindFetchProfilesForClass
public static void bindFetchProfilesForClass(org.hibernate.annotations.common.reflection.XClass annotatedClass, MetadataBuildingContext context)
-
bindFetchProfilesForPackage
public static void bindFetchProfilesForPackage(ClassLoaderService cls, String packageName, MetadataBuildingContext context)
-
processElementAnnotations
public static void processElementAnnotations(PropertyHolder propertyHolder, Nullability nullability, PropertyData inferredData, Map<String,IdentifierGeneratorDefinition> classGenerators, EntityBinder entityBinder, boolean isIdentifierMapper, boolean isComponentEmbedded, boolean inSecondPass, MetadataBuildingContext context, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass) throws MappingException
Process annotation of a particular property or field.- Throws:
MappingException
-
generatorType
public static String generatorType(jakarta.persistence.GeneratedValue generatedValue, org.hibernate.annotations.common.reflection.XClass javaClass, MetadataBuildingContext context)
-
fillComponent
public static Component fillComponent(PropertyHolder propertyHolder, PropertyData inferredData, AccessType propertyAccessor, boolean isNullable, EntityBinder entityBinder, boolean isComponentEmbedded, boolean isIdentifierMapper, boolean inSecondPass, Class<? extends EmbeddableInstantiator> customInstantiatorImpl, Class<? extends CompositeUserType<?>> compositeUserTypeClass, AnnotatedColumns columns, MetadataBuildingContext context, 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, Class<? extends EmbeddableInstantiator> customInstantiatorImpl, Class<? extends CompositeUserType<?>> compositeUserTypeClass, AnnotatedColumns columns, MetadataBuildingContext context, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)
-
createComponent
public static Component createComponent(PropertyHolder propertyHolder, PropertyData inferredData, boolean isComponentEmbedded, boolean isIdentifierMapper, Class<? extends EmbeddableInstantiator> customInstantiatorImpl, MetadataBuildingContext context)
-
getUniqueIdPropertyFromBaseClass
public static PropertyData getUniqueIdPropertyFromBaseClass(PropertyData inferredData, PropertyData baseInferredData, AccessType propertyAccessor, MetadataBuildingContext context)
-
buildGenerators
public static Map<String,IdentifierGeneratorDefinition> buildGenerators(org.hibernate.annotations.common.reflection.XAnnotatedElement annotatedElement, MetadataBuildingContext context)
-
isDefault
public static boolean isDefault(org.hibernate.annotations.common.reflection.XClass clazz, MetadataBuildingContext context)
-
buildInheritanceStates
public static Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> buildInheritanceStates(List<org.hibernate.annotations.common.reflection.XClass> orderedClasses, MetadataBuildingContext buildingContext)
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 theirXClass.
-
resolveInstantiator
public static Constructor<?> resolveInstantiator(org.hibernate.annotations.common.reflection.XClass embeddableClass, MetadataBuildingContext buildingContext)
-
-