Top Description Methods
org.hibernate.tuple

public Interface AnnotationValueGeneration<A extends java.lang.annotation.Annotation>

extends ValueGeneration, AnnotationBasedGenerator<A extends Annotation>
Known Direct Implementers
org.hibernate.tuple.CreationTimestampGeneration, org.hibernate.tuple.UpdateTimestampGeneration
Annotations
@Deprecated
since:6.2
forRemoval:true
Type Parameters
<A>
The generator annotation type supported by an implementation
Imports
java.lang.annotation.Annotation, java.lang.reflect.Field, .Member, .Method, org.hibernate.AssertionFailure, org.hibernate.generator.AnnotationBasedGenerator, .Generator, .GeneratorCreationContext

Deprecated

for removal since 6.2.

Replaced by AnnotationBasedGenerator

An implementation of ValueGeneration which receives parameters from a custom generator annotation.

This is an older API that predates Generator and AnnotationBasedGenerator. It's often cleaner to implement AnnotationBasedGenerator directly.

Author
Gunnar Morling
See Also
org.hibernate.annotations.ValueGenerationType, ValueGeneration

Method Summary

Modifier and TypeMethod and Description
private static Class<?>
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
,
Class<?>
the type of the property annotated with the generator annotation.
propertyType
)

Initializes this generation strategy for the given annotation instance.

public default 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)

Implements org.hibernate.generator.AnnotationBasedGenerator.initialize.

Initializes this generation strategy for the given annotation instance.
Inherited from org.hibernate.tuple.ValueGeneration:
generategeneratedOnExecutiongetDatabaseGeneratedReferencedColumnValuegetDatabaseGeneratedReferencedColumnValuegetEventTypesgetGenerationTiminggetReferencedColumnValuesgetValueGeneratorreferenceColumnInSqlreferenceColumnsInSqlwritePropertyValue

Method Detail

getPropertyTypeback to summary
private static Class<?> getPropertyType(Member member)
initializeback to summary
public void initialize(A annotation, Class<?> propertyType)

Initializes this generation strategy for the given annotation instance.

Parameters
annotation:A

an instance of the strategy's annotation type. Typically, implementations will retrieve the annotation's attribute values and store them in fields.

propertyType:Class<?>

the type of the property annotated with the generator annotation.

Exceptions
HibernateException:
in case an error occurred during initialization, e.g. if an implementation can't create a value for the given property type.
initializeback to summary
public default void initialize(A annotation, Member member, GeneratorCreationContext context)

Implements org.hibernate.generator.AnnotationBasedGenerator.initialize.

Doc from org.hibernate.generator.AnnotationBasedGenerator.initialize.

Initializes this generation strategy for the given annotation instance.

Parameters
annotation:A

an instance of the strategy's annotation type. Typically, implementations will retrieve the annotation's attribute values and store them in fields.

member:Member

the Java member annotated with the generator annotation.

context:GeneratorCreationContext

a GeneratorCreationContext