HHH-12811 Add @Target annotations to @CreationTimestamp and @UpdateTimestamp
This commit is contained in:
parent
1688c3ff8d
commit
e4ae86cce2
|
@ -6,10 +6,14 @@
|
|||
*/
|
||||
package org.hibernate.annotations;
|
||||
|
||||
import org.hibernate.tuple.CreationTimestampGeneration;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.hibernate.tuple.CreationTimestampGeneration;
|
||||
|
||||
/**
|
||||
* Marks a property as the creation timestamp of the containing entity. The property value will be set to the current
|
||||
|
@ -38,5 +42,6 @@ import java.lang.annotation.RetentionPolicy;
|
|||
*/
|
||||
@ValueGenerationType(generatedBy = CreationTimestampGeneration.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ FIELD, METHOD })
|
||||
public @interface CreationTimestamp {
|
||||
}
|
||||
|
|
|
@ -6,10 +6,14 @@
|
|||
*/
|
||||
package org.hibernate.annotations;
|
||||
|
||||
import org.hibernate.tuple.UpdateTimestampGeneration;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.hibernate.tuple.UpdateTimestampGeneration;
|
||||
|
||||
/**
|
||||
* Marks a property as the update timestamp of the containing entity. The property value will be set to the current VM
|
||||
|
@ -38,5 +42,6 @@ import java.lang.annotation.RetentionPolicy;
|
|||
*/
|
||||
@ValueGenerationType(generatedBy = UpdateTimestampGeneration.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ FIELD, METHOD })
|
||||
public @interface UpdateTimestamp {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue