From 29f205dea231e7198ae99df449baaf38bd3879af Mon Sep 17 00:00:00 2001 From: Gavin King Date: Mon, 20 May 2024 12:44:42 +0200 Subject: [PATCH] add a note to Javadoc of IdGeneratorType Signed-off-by: Gavin King --- .../main/java/org/hibernate/annotations/IdGeneratorType.java | 4 ++++ .../java/org/hibernate/annotations/ValueGenerationType.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/IdGeneratorType.java b/hibernate-core/src/main/java/org/hibernate/annotations/IdGeneratorType.java index 50657efb6e..7d3410cfc7 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/IdGeneratorType.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/IdGeneratorType.java @@ -68,6 +68,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; *

* A {@code @IdGeneratorType} annotation must have retention policy * {@link RetentionPolicy#RUNTIME}. + *

+ * If a {@code Generator} may be used to generate values of non-identifier + * fields, its generator annotation should also be meta-annotated + * {@link ValueGenerationType @ValueGenerationType}. * * @see Generator * @see AnnotationBasedGenerator diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/ValueGenerationType.java b/hibernate-core/src/main/java/org/hibernate/annotations/ValueGenerationType.java index 041939cb33..072e3d79f8 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/ValueGenerationType.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/ValueGenerationType.java @@ -55,7 +55,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * the property to be generated when any SQL statement to {@code insert} or * {@code update} the entity is executed. *

- * Every generator annotation type has an {@link Generator} implementation + * Every generator annotation type has a {@link Generator} implementation * which is responsible for generating values. It must be either: *