Generator which receives parameters from a custom
generator annotation or
id generator annotation.
Implementing this interface is the same as providing a constructor with the same
signature as the initialize method. But implementing this interface is
slightly more typesafe.
For example, implementing AnnotationBasedGenerator<AnnotationType> is the
same as providing a constructor with this signature:
public GeneratorClass(AnnotationType config, Member idMember,
CustomIdGeneratorCreationContext creationContext)
where GeneratorClass is the class that implements Generator, and
AnnotationType is the generator annotation type used to configure the
generator.
Every instance of this class must implement either BeforeExecutionGenerator or
OnExecutionGenerator.
org.hibernate.annotations.ValueGenerationType , org.hibernate.annotations.IdGeneratorType
| Modifier and Type | Method and Description |
|---|---|
| public void | initialize(A
an instance of the strategy's annotation type. Typically,
implementations will retrieve the annotation's attribute
values and store them in fields. annotation, Member the Java member annotated with the generator annotation. member, GeneratorCreationContext context)Initializes this generation strategy for the given annotation instance. |
| initialize | back to summary |
|---|---|
| public void initialize(A annotation, Member member, GeneratorCreationContext context) Initializes this generation strategy for the given annotation instance.
| |