Annotation Interface TimeZoneStorage


@Incubating @Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface TimeZoneStorage
Specifies how the time zone information of a persistent property or field should be persisted. This annotation may be used in conjunction with the Basic annotation, or in conjunction with the ElementCollection annotation when the element collection value is of basic type. If the TimeZoneStorage annotation is not used, the TimeZoneStorageType has a default value determined by the dialect and by the configuration property "hibernate.timezone.default_storage".

For example:

 @Entity
 public class Person {

     @Column(name = "birth_timestamp")
     @TimeZoneColumn(name = "birth_zone")
     @TimeZoneStorage(COLUMN)
     public OffsetDateTime birthDate;

     @TimeZoneStorage(NATIVE)
     public OffsetDateTime registrationDate;

     ...
 }
 
Since:
6.0
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The storage strategy for the time zone information.
  • Element Details

    • value

      The storage strategy for the time zone information.
      Default:
      AUTO