Top Description Fields Constructors Methods
org.hibernate

public final Enum TimeZoneStorageStrategy

extends Enum<TimeZoneStorageStrategy>
Class Inheritance
Annotations
@Incubating

Enumerates the possible storage strategies for offset or zoned datetimes.
Authors
Christian Beikov, Steve Ebersole, Andrea Boriero
See Also
org.hibernate.annotations.TimeZoneStorageType, org.hibernate.dialect.TimeZoneSupport

Field Summary

Modifier and TypeField and Description
public static final TimeZoneStorageStrategy
COLUMN

Stores the time zone in a separate column.

public static final TimeZoneStorageStrategy
NATIVE

Stores the time zone via the with time zone SQL types which retain the information.

public static final TimeZoneStorageStrategy
NORMALIZE

Does not store the time zone, and instead:

  • when persisting to the database, normalizes JDBC timestamps to the org.hibernate.cfg.AvailableSettings#JDBC_TIME_ZONE or to the JVM default time zone otherwise.
  • when reading back from the database, sets the offset or zone of OffsetDateTime/ZonedDateTime properties to the JVM default time zone.
public static final TimeZoneStorageStrategy
NORMALIZE_UTC

Doesn't store the time zone, but instead normalizes to UTC.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static TimeZoneStorageStrategy
public static TimeZoneStorageStrategy[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COLUMNback to summary
public static final TimeZoneStorageStrategy COLUMN

Stores the time zone in a separate column.

NATIVEback to summary
public static final TimeZoneStorageStrategy NATIVE

Stores the time zone via the with time zone SQL types which retain the information.

NORMALIZEback to summary
public static final TimeZoneStorageStrategy NORMALIZE

Does not store the time zone, and instead:

  • when persisting to the database, normalizes JDBC timestamps to the org.hibernate.cfg.AvailableSettings#JDBC_TIME_ZONE or to the JVM default time zone otherwise.
  • when reading back from the database, sets the offset or zone of OffsetDateTime/ZonedDateTime properties to the JVM default time zone.

Provided partly for backward compatibility with older versions of Hibernate.

NORMALIZE_UTCback to summary
public static final TimeZoneStorageStrategy NORMALIZE_UTC

Doesn't store the time zone, but instead normalizes to UTC.

Constructor Detail

TimeZoneStorageStrategyback to summary
private TimeZoneStorageStrategy()

Method Detail

valueOfback to summary
public static TimeZoneStorageStrategy valueOf(String name)
valuesback to summary
public static TimeZoneStorageStrategy[] values()