Class GeneratorBinder
java.lang.Object
org.hibernate.boot.model.internal.GeneratorBinder
Responsible for configuring and instantiating
Generator
s.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyIfNotEmpty
(String name, String value, BiConsumer<String, String> consumer) static BeanContainer
beanContainer
(MetadataBuildingContext buildingContext) Obtain aBeanContainer
to be used for instantiating generators.static void
callConfigure
(GeneratorCreationContext creationContext, Generator generator, Map<String, Object> configuration, SimpleValue identifierValue) static <A extends Annotation>
voidcallInitialize
(A annotation, org.hibernate.models.spi.MemberDetails memberDetails, GeneratorCreationContext creationContext, Generator generator) static void
createGeneratorFrom
(IdentifierGeneratorDefinition defaultedGenerator, SimpleValue idValue, Map<String, Object> configuration, MetadataBuildingContext context) static void
createGeneratorFrom
(IdentifierGeneratorDefinition defaultedGenerator, SimpleValue idValue, MetadataBuildingContext context) static <T extends Generator>
TinstantiateGenerator
(BeanContainer beanContainer, Class<T> generatorClass) Instantiate aGenerator
, using the givenBeanContainer
if any, or by calling the default constructor otherwise.static void
makeIdGenerator
(MappingDocument sourceDocument, IdentifierGeneratorDefinition definition, SimpleValue identifierValue, MetadataBuildingContext context) Set up the identifier generator for an id defined in ahbm.xml
mapping.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 aGeneratedValue
annotation.static void
registerGlobalGenerators
(org.hibernate.models.spi.AnnotationTarget annotatedElement, MetadataBuildingContext context) static void
visitIdGeneratorDefinitions
(org.hibernate.models.spi.AnnotationTarget annotatedElement, Consumer<IdentifierGeneratorDefinition> consumer, MetadataBuildingContext context)
-
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 aGeneratedValue
annotation. -
visitIdGeneratorDefinitions
public static void visitIdGeneratorDefinitions(org.hibernate.models.spi.AnnotationTarget annotatedElement, Consumer<IdentifierGeneratorDefinition> consumer, MetadataBuildingContext context) -
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 givenBeanContainer
if any, or by calling the default constructor otherwise.- Parameters:
beanContainer
- an optionalBeanContainer
generatorClass
- 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
public static void callConfigure(GeneratorCreationContext creationContext, Generator generator, Map<String, Object> configuration, SimpleValue identifierValue) -
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.xml
mapping.- See Also:
-
beanContainer
Obtain aBeanContainer
to be used for instantiating generators. -
applyIfNotEmpty
-