Top Description Methods
org.hibernate.annotations

public @Interface TimeZoneStorage

extends Annotation
Annotations
@Incubating
@Retention:RUNTIME
@Target:FIELD, METHOD
Imports
java.lang.annotation.Retention, .RetentionPolicy, .Target, org.hibernate.Incubating

Specifies how the time zone information of a persistent property or field should be persisted. This annotation may be used in conjunction with the jakarta.persistence.Basic annotation, or in conjunction with the jakarta.persistence.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;

    ...
}
Authors
Christian Beikov, Steve Ebersole, Andrea Boriero
Since
6.0
See Also
TimeZoneStorageType, TimeZoneColumn

Method Summary

Modifier and TypeMethod and Description
public TimeZoneStorageType
value()

The storage strategy for the time zone information.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public TimeZoneStorageType value()

The storage strategy for the time zone information.