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, 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, NORMALIZE,
/** /**

View File

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