HHH-16302 Document that TimeZoneStorageType.NORMALIZE normalizes to the JVM timezone, not to hibernate.jdbc.time_zone, upon reading values

This commit is contained in:
Yoann Rodière 2023-03-14 13:18:06 +01:00
parent 204278164d
commit 1974abb6dc
2 changed files with 19 additions and 7 deletions

View File

@ -28,7 +28,18 @@ public enum TimeZoneStorageStrategy {
*/
COLUMN,
/**
* Doesn't store the time zone, but instead normalizes to the JDBC timezone.
* Does not store the time zone, and instead:
* <ul>
* <li>when persisting to the database, normalizes JDBC timestamps to the
* {@linkplain org.hibernate.cfg.AvailableSettings#JDBC_TIME_ZONE}
* or to the JVM default time zone otherwise.
* <li>when reading back from the database, sets the offset or zone
* of {@code OffsetDateTime}/{@code ZonedDateTime} properties
* to the JVM default time zone.
* </ul>
* <p>
* Provided partly for backward compatibility with older
* versions of Hibernate.
*/
NORMALIZE,
/**

View File

@ -78,15 +78,16 @@ public enum TimeZoneStorageType {
/**
* Does not store the time zone, and instead:
* <ul>
* <li>normalizes JDBC timestamps to the
* {@linkplain org.hibernate.cfg.AvailableSettings#JDBC_TIME_ZONE
* JDBC timezone}, if set, or
* <li>passes them through in the JVM default time zone
* otherwise.
* <li>when persisting to the database, normalizes JDBC timestamps to the
* {@linkplain org.hibernate.cfg.AvailableSettings#JDBC_TIME_ZONE}
* or to the JVM default time zone if not set.
* <li>when reading back from the database, sets the offset or zone
* of {@code OffsetDateTime}/{@code ZonedDateTime} values
* to the JVM default time zone.
* </ul>
* <p>
* Provided partly for backward compatibility with older
* versions of Hibernate
* versions of Hibernate.
*/
NORMALIZE,
/**