@CreationTimestamp should not be declared @Inherited

This commit is contained in:
Gavin 2022-11-28 19:22:56 +01:00 committed by Gavin King
parent 457872dbdd
commit e908d4c8f6
3 changed files with 11 additions and 10 deletions

View File

@ -8,9 +8,9 @@ package org.hibernate.annotations;
import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.hibernate.tuple.CreationTimestampGeneration; import org.hibernate.tuple.CreationTimestampGeneration;
@ -29,7 +29,7 @@ import org.hibernate.tuple.CreationTimestampGeneration;
* @see CurrentTimestamp * @see CurrentTimestamp
*/ */
@ValueGenerationType(generatedBy = CreationTimestampGeneration.class) @ValueGenerationType(generatedBy = CreationTimestampGeneration.class)
@Retention(RetentionPolicy.RUNTIME) @Retention(RUNTIME)
@Target({ FIELD, METHOD }) @Target({ FIELD, METHOD })
public @interface CreationTimestamp { public @interface CreationTimestamp {
/** /**

View File

@ -6,14 +6,16 @@
*/ */
package org.hibernate.annotations; package org.hibernate.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.hibernate.tuple.GenerationTiming; import org.hibernate.tuple.GenerationTiming;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Specifies that the annotated field of property is a generated timestamp, * Specifies that the annotated field of property is a generated timestamp,
* and also specifies the {@linkplain #timing() timing} of the timestamp * and also specifies the {@linkplain #timing() timing} of the timestamp
@ -56,9 +58,8 @@ import org.hibernate.tuple.GenerationTiming;
* @see CreationTimestamp * @see CreationTimestamp
*/ */
@ValueGenerationType(generatedBy = CurrentTimestampGeneration.class) @ValueGenerationType(generatedBy = CurrentTimestampGeneration.class)
@Retention(RetentionPolicy.RUNTIME) @Retention(RUNTIME)
@Target( { ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE } ) @Target({ FIELD, METHOD, ANNOTATION_TYPE })
@Inherited
public @interface CurrentTimestamp { public @interface CurrentTimestamp {
/** /**
* Determines when the timestamp is generated. But default, it is updated * Determines when the timestamp is generated. But default, it is updated

View File

@ -8,9 +8,9 @@ package org.hibernate.annotations;
import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.hibernate.tuple.UpdateTimestampGeneration; import org.hibernate.tuple.UpdateTimestampGeneration;
@ -29,7 +29,7 @@ import org.hibernate.tuple.UpdateTimestampGeneration;
* @author Gunnar Morling * @author Gunnar Morling
*/ */
@ValueGenerationType(generatedBy = UpdateTimestampGeneration.class) @ValueGenerationType(generatedBy = UpdateTimestampGeneration.class)
@Retention(RetentionPolicy.RUNTIME) @Retention(RUNTIME)
@Target({ FIELD, METHOD }) @Target({ FIELD, METHOD })
public @interface UpdateTimestamp { public @interface UpdateTimestamp {
/** /**