Class GeneratorBinder
java.lang.Object
org.hibernate.boot.model.internal.GeneratorBinder
Responsible for configuring and instantiating
Generators.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyIfNotEmpty(String name, String value, BiConsumer<String, String> consumer) static BeanContainerbeanContainer(MetadataBuildingContext buildingContext) Obtain aBeanContainerto be used for instantiating generators.static voidcallConfigure(GeneratorCreationContext creationContext, Generator generator, Map<String, Object> configuration, Value value) static <A extends Annotation>
voidcallInitialize(A annotation, org.hibernate.models.spi.MemberDetails memberDetails, GeneratorCreationContext creationContext, Generator generator) static voidcreateGeneratorFrom(IdentifierGeneratorDefinition defaultedGenerator, SimpleValue idValue, Map<String, Object> configuration, MetadataBuildingContext context) static voidcreateGeneratorFrom(IdentifierGeneratorDefinition defaultedGenerator, SimpleValue idValue, MetadataBuildingContext context) static <T extends Generator>
TinstantiateGenerator(BeanContainer beanContainer, Class<T> generatorClass) Instantiate aGenerator, using the givenBeanContainerif any, or by calling the default constructor otherwise.static voidmakeIdGenerator(MappingDocument sourceDocument, IdentifierGeneratorDefinition definition, SimpleValue identifierValue, MetadataBuildingContext context) Set up the identifier generator for an id defined in ahbm.xmlmapping.static voidmakeIdGenerator(SimpleValue identifierValue, org.hibernate.models.spi.MemberDetails idAttributeMember, String generatorType, String generatorName, MetadataBuildingContext context, Map<String, ? extends IdentifierGeneratorDefinition> localGenerators) Create a generator, based on aGeneratedValueannotation.static voidregisterGlobalGenerators(org.hibernate.models.spi.AnnotationTarget annotatedElement, MetadataBuildingContext context) static voidvisitIdGeneratorDefinitions(org.hibernate.models.spi.AnnotationTarget annotatedElement, Consumer<IdentifierGeneratorDefinition> consumer, MetadataBuildingContext buildingContext)
-
Field Details
-
ASSIGNED_GENERATOR_NAME
- See Also:
-
ASSIGNED_IDENTIFIER_GENERATOR_CREATOR
-
-
Constructor Details
-
GeneratorBinder
public GeneratorBinder()
-
-
Method Details
-
makeIdGenerator
public static void makeIdGenerator(SimpleValue identifierValue, org.hibernate.models.spi.MemberDetails idAttributeMember, String generatorType, String generatorName, MetadataBuildingContext context, Map<String, ? extends IdentifierGeneratorDefinition> localGenerators) Create a generator, based on aGeneratedValueannotation. -
visitIdGeneratorDefinitions
public static void visitIdGeneratorDefinitions(org.hibernate.models.spi.AnnotationTarget annotatedElement, Consumer<IdentifierGeneratorDefinition> consumer, MetadataBuildingContext buildingContext) -
registerGlobalGenerators
public static void registerGlobalGenerators(org.hibernate.models.spi.AnnotationTarget annotatedElement, MetadataBuildingContext context) -
instantiateGenerator
public static <T extends Generator> T instantiateGenerator(BeanContainer beanContainer, Class<T> generatorClass) Instantiate aGenerator, using the givenBeanContainerif any, or by calling the default constructor otherwise.- Parameters:
beanContainer- an optionalBeanContainergeneratorClass- a class which implementsGenerator
-
callInitialize
public static <A extends Annotation> void callInitialize(A annotation, org.hibernate.models.spi.MemberDetails memberDetails, GeneratorCreationContext creationContext, Generator generator) -
callConfigure
-
createGeneratorFrom
public static void createGeneratorFrom(IdentifierGeneratorDefinition defaultedGenerator, SimpleValue idValue, Map<String, Object> configuration, MetadataBuildingContext context) -
createGeneratorFrom
public static void createGeneratorFrom(IdentifierGeneratorDefinition defaultedGenerator, SimpleValue idValue, MetadataBuildingContext context) -
makeIdGenerator
public static void makeIdGenerator(MappingDocument sourceDocument, IdentifierGeneratorDefinition definition, SimpleValue identifierValue, MetadataBuildingContext context) Set up the identifier generator for an id defined in ahbm.xmlmapping.- See Also:
-
beanContainer
Obtain aBeanContainerto be used for instantiating generators. -
applyIfNotEmpty
-