From ef2d2aa8ead0b1ce6d06ac59e9fde0571951c1a3 Mon Sep 17 00:00:00 2001 From: Ankur Mhatre Date: Wed, 28 Oct 2026 18:37:30 +0000 Subject: [PATCH] Add date-time module: Instant vs LocalDateTime vs OffsetDateTime vs ZonedDateTime round-tripped across JVM time zones on H2 and PostgreSQL Hibernate 7.4.14.Final (plus an 8.0.0.Beta4 preview run), H2 2.5.252, PostgreSQL 17.11 in Docker. Same-JVM and cross-zone round trips, @TimeZoneStorage modes, DST gap/overlap, precision (precision vs secondPrecision), hibernate.jdbc.time_zone, java_time_use_direct_jdbc default flip. Supersedes the date/time experiments of docs/13 (7.4.5); chapter 13 is unchanged. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy --- README.md | 1 + date-time/README.md | 71 +++++++++ date-time/output/00-environment.txt | 8 + ...erica_New_York-same-jvm-directfalse-h8.txt | 10 ++ ...merica_New_York-same-jvm-directtrue-h7.txt | 10 ++ ...ndtrip-h2-America_New_York-same-jvm-h7.txt | 10 ++ ...ndtrip-h2-America_New_York-same-jvm-h8.txt | 10 ++ ...ca_New_York-written-in-Asia_Kolkata-h7.txt | 11 ++ ...-roundtrip-h2-Asia_Kolkata-same-jvm-h7.txt | 10 ++ ...-roundtrip-h2-Asia_Kolkata-same-jvm-h8.txt | 10 ++ ...Kolkata-written-in-America_New_York-h7.txt | 11 ++ ...erica_New_York-same-jvm-directfalse-h8.txt | 10 ++ ...merica_New_York-same-jvm-directtrue-h7.txt | 10 ++ ...-postgres-America_New_York-same-jvm-h7.txt | 10 ++ ...-postgres-America_New_York-same-jvm-h8.txt | 10 ++ ...ca_New_York-written-in-Asia_Kolkata-h7.txt | 11 ++ ...trip-postgres-Asia_Kolkata-same-jvm-h7.txt | 10 ++ ...trip-postgres-Asia_Kolkata-same-jvm-h8.txt | 10 ++ ...Kolkata-written-in-America_New_York-h7.txt | 11 ++ ...ew_York-local-date-time-directfalse-h8.txt | 6 + ...New_York-local-date-time-directtrue-h7.txt | 6 + ...h2-America_New_York-local-date-time-h7.txt | 6 + ...h2-America_New_York-local-date-time-h8.txt | 6 + ...dst-h2-Asia_Kolkata-local-date-time-h7.txt | 6 + ...dst-h2-Asia_Kolkata-local-date-time-h8.txt | 6 + ...ew_York-local-date-time-directfalse-h8.txt | 6 + ...New_York-local-date-time-directtrue-h7.txt | 6 + ...es-America_New_York-local-date-time-h7.txt | 6 + ...es-America_New_York-local-date-time-h8.txt | 6 + ...stgres-Asia_Kolkata-local-date-time-h7.txt | 6 + ...stgres-Asia_Kolkata-local-date-time-h8.txt | 6 + ...ion-h2-America_New_York-directfalse-h8.txt | 7 + ...sion-h2-America_New_York-directtrue-h7.txt | 7 + .../03-precision-h2-America_New_York-h7.txt | 7 + .../03-precision-h2-America_New_York-h8.txt | 7 + .../03-precision-h2-Asia_Kolkata-h7.txt | 7 + .../03-precision-h2-Asia_Kolkata-h8.txt | 7 + .../03-precision-hsqldb-Asia_Kolkata-h7.txt | 7 + ...stgres-America_New_York-directfalse-h8.txt | 7 + ...ostgres-America_New_York-directtrue-h7.txt | 7 + ...precision-postgres-America_New_York-h7.txt | 7 + ...precision-postgres-America_New_York-h8.txt | 7 + .../03-precision-postgres-Asia_Kolkata-h7.txt | 7 + .../03-precision-postgres-Asia_Kolkata-h8.txt | 7 + ...ostgres-America_New_York-directtrue-h7.txt | 9 ++ ...erica_New_York-same-jvm-directfalse-h8.txt | 5 + ...merica_New_York-same-jvm-directtrue-h7.txt | 5 + ...-zoned-h2-America_New_York-same-jvm-h7.txt | 5 + ...-zoned-h2-America_New_York-same-jvm-h8.txt | 5 + ...ca_New_York-written-in-Asia_Kolkata-h7.txt | 5 + .../04-zoned-h2-Asia_Kolkata-same-jvm-h7.txt | 5 + .../04-zoned-h2-Asia_Kolkata-same-jvm-h8.txt | 5 + ...Kolkata-written-in-America_New_York-h7.txt | 5 + ...erica_New_York-same-jvm-directfalse-h8.txt | 5 + ...-postgres-America_New_York-same-jvm-h7.txt | 5 + ...-postgres-America_New_York-same-jvm-h8.txt | 5 + ...ca_New_York-written-in-Asia_Kolkata-h7.txt | 5 + ...oned-postgres-Asia_Kolkata-same-jvm-h7.txt | 5 + ...oned-postgres-Asia_Kolkata-same-jvm-h8.txt | 5 + ...Kolkata-written-in-America_New_York-h7.txt | 5 + ...ddl-h2-America_New_York-directfalse-h8.txt | 16 ++ ...-ddl-h2-America_New_York-directtrue-h7.txt | 16 ++ .../output/05-ddl-h2-America_New_York-h7.txt | 16 ++ .../output/05-ddl-h2-America_New_York-h8.txt | 16 ++ .../output/05-ddl-h2-Asia_Kolkata-h7.txt | 16 ++ .../output/05-ddl-h2-Asia_Kolkata-h8.txt | 16 ++ ...stgres-America_New_York-directfalse-h8.txt | 16 ++ ...ostgres-America_New_York-directtrue-h7.txt | 16 ++ .../05-ddl-postgres-America_New_York-h7.txt | 16 ++ .../05-ddl-postgres-America_New_York-h8.txt | 16 ++ .../05-ddl-postgres-Asia_Kolkata-h7.txt | 16 ++ .../05-ddl-postgres-Asia_Kolkata-h8.txt | 16 ++ ...one-h2-America_New_York-directfalse-h8.txt | 6 + ...zone-h2-America_New_York-directtrue-h7.txt | 6 + ...-jdbc-time-zone-h2-America_New_York-h7.txt | 6 + ...-jdbc-time-zone-h2-America_New_York-h8.txt | 6 + .../06-jdbc-time-zone-h2-Asia_Kolkata-h7.txt | 6 + .../06-jdbc-time-zone-h2-Asia_Kolkata-h8.txt | 6 + ...stgres-America_New_York-directfalse-h8.txt | 6 + ...ostgres-America_New_York-directtrue-h7.txt | 6 + ...time-zone-postgres-America_New_York-h7.txt | 6 + ...time-zone-postgres-America_New_York-h8.txt | 6 + ...dbc-time-zone-postgres-Asia_Kolkata-h7.txt | 6 + ...dbc-time-zone-postgres-Asia_Kolkata-h8.txt | 6 + ...rica_New_York-timestamp-directfalse-h8.txt | 4 + ...erica_New_York-timestamp-directtrue-h7.txt | 4 + ...-type-h2-America_New_York-timestamp-h7.txt | 4 + ...-type-h2-America_New_York-timestamp-h8.txt | 4 + ..._New_York-timestamp_utc-directfalse-h8.txt | 4 + ...a_New_York-timestamp_utc-directtrue-h7.txt | 4 + ...e-h2-America_New_York-timestamp_utc-h7.txt | 4 + ...e-h2-America_New_York-timestamp_utc-h8.txt | 4 + ...jdbc-type-h2-Asia_Kolkata-timestamp-h7.txt | 4 + ...jdbc-type-h2-Asia_Kolkata-timestamp-h8.txt | 4 + ...-type-h2-Asia_Kolkata-timestamp_utc-h7.txt | 4 + ...-type-h2-Asia_Kolkata-timestamp_utc-h8.txt | 4 + ...rica_New_York-timestamp-directfalse-h8.txt | 4 + ...erica_New_York-timestamp-directtrue-h7.txt | 4 + ...postgres-America_New_York-timestamp-h7.txt | 4 + ...postgres-America_New_York-timestamp-h8.txt | 4 + ..._New_York-timestamp_utc-directfalse-h8.txt | 4 + ...a_New_York-timestamp_utc-directtrue-h7.txt | 4 + ...gres-America_New_York-timestamp_utc-h7.txt | 4 + ...gres-America_New_York-timestamp_utc-h8.txt | 4 + ...ype-postgres-Asia_Kolkata-timestamp-h7.txt | 4 + ...ype-postgres-Asia_Kolkata-timestamp-h8.txt | 4 + ...postgres-Asia_Kolkata-timestamp_utc-h7.txt | 4 + ...postgres-Asia_Kolkata-timestamp_utc-h8.txt | 4 + ...ion-h2-America_New_York-directfalse-h8.txt | 13 ++ ...sion-h2-America_New_York-directtrue-h7.txt | 13 ++ ...olumn-precision-h2-America_New_York-h7.txt | 13 ++ ...olumn-precision-h2-America_New_York-h8.txt | 13 ++ ...08-column-precision-h2-Asia_Kolkata-h7.txt | 13 ++ ...08-column-precision-h2-Asia_Kolkata-h8.txt | 13 ++ ...stgres-America_New_York-directfalse-h8.txt | 13 ++ ...ostgres-America_New_York-directtrue-h7.txt | 13 ++ ...precision-postgres-America_New_York-h7.txt | 13 ++ ...precision-postgres-America_New_York-h8.txt | 13 ++ ...umn-precision-postgres-Asia_Kolkata-h7.txt | 13 ++ ...umn-precision-postgres-Asia_Kolkata-h8.txt | 13 ++ ...pes-h2-America_New_York-directfalse-h8.txt | 12 ++ ...ypes-h2-America_New_York-directtrue-h7.txt | 12 ++ ...09-legacy-types-h2-America_New_York-h7.txt | 12 ++ ...09-legacy-types-h2-America_New_York-h8.txt | 12 ++ .../09-legacy-types-h2-Asia_Kolkata-h7.txt | 12 ++ .../09-legacy-types-h2-Asia_Kolkata-h8.txt | 12 ++ ...stgres-America_New_York-directfalse-h8.txt | 12 ++ ...ostgres-America_New_York-directtrue-h7.txt | 12 ++ ...acy-types-postgres-America_New_York-h7.txt | 12 ++ ...acy-types-postgres-America_New_York-h8.txt | 12 ++ ...-legacy-types-postgres-Asia_Kolkata-h7.txt | 12 ++ ...-legacy-types-postgres-Asia_Kolkata-h8.txt | 12 ++ .../output/10-javap-hibernate-settings.txt | 25 ++++ .../output/10-javap-jakarta-persistence.txt | 16 ++ date-time/pom.xml | 95 ++++++++++++ date-time/scripts/javap-facts.sh | 32 ++++ date-time/scripts/run-all.sh | 80 ++++++++++ .../src/main/java/com/ankurm/datetime/Db.java | 75 ++++++++++ .../main/java/com/ankurm/datetime/Event.java | 78 ++++++++++ .../main/java/com/ankurm/datetime/Legacy.java | 49 ++++++ .../com/ankurm/datetime/PrecisionEvent.java | 54 +++++++ .../main/java/com/ankurm/datetime/Probe.java | 48 ++++++ .../java/com/ankurm/datetime/ZonedEvent.java | 42 ++++++ .../com/ankurm/datetime/EdgeCasesTest.java | 139 ++++++++++++++++++ .../com/ankurm/datetime/JdbcTimeZoneTest.java | 96 ++++++++++++ .../com/ankurm/datetime/RoundTripTest.java | 130 ++++++++++++++++ .../java/com/ankurm/datetime/Transcript.java | 56 +++++++ .../java/com/ankurm/datetime/TypesTest.java | 91 ++++++++++++ .../java/com/ankurm/datetime/ZonedTest.java | 117 +++++++++++++++ 149 files changed, 2374 insertions(+) create mode 100644 date-time/README.md create mode 100644 date-time/output/00-environment.txt create mode 100644 date-time/output/01-roundtrip-h2-America_New_York-same-jvm-directfalse-h8.txt create mode 100644 date-time/output/01-roundtrip-h2-America_New_York-same-jvm-directtrue-h7.txt create mode 100644 date-time/output/01-roundtrip-h2-America_New_York-same-jvm-h7.txt create mode 100644 date-time/output/01-roundtrip-h2-America_New_York-same-jvm-h8.txt create mode 100644 date-time/output/01-roundtrip-h2-America_New_York-written-in-Asia_Kolkata-h7.txt create mode 100644 date-time/output/01-roundtrip-h2-Asia_Kolkata-same-jvm-h7.txt create mode 100644 date-time/output/01-roundtrip-h2-Asia_Kolkata-same-jvm-h8.txt create mode 100644 date-time/output/01-roundtrip-h2-Asia_Kolkata-written-in-America_New_York-h7.txt create mode 100644 date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-directfalse-h8.txt create mode 100644 date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-directtrue-h7.txt create mode 100644 date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-h7.txt create mode 100644 date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-h8.txt create mode 100644 date-time/output/01-roundtrip-postgres-America_New_York-written-in-Asia_Kolkata-h7.txt create mode 100644 date-time/output/01-roundtrip-postgres-Asia_Kolkata-same-jvm-h7.txt create mode 100644 date-time/output/01-roundtrip-postgres-Asia_Kolkata-same-jvm-h8.txt create mode 100644 date-time/output/01-roundtrip-postgres-Asia_Kolkata-written-in-America_New_York-h7.txt create mode 100644 date-time/output/02-dst-h2-America_New_York-local-date-time-directfalse-h8.txt create mode 100644 date-time/output/02-dst-h2-America_New_York-local-date-time-directtrue-h7.txt create mode 100644 date-time/output/02-dst-h2-America_New_York-local-date-time-h7.txt create mode 100644 date-time/output/02-dst-h2-America_New_York-local-date-time-h8.txt create mode 100644 date-time/output/02-dst-h2-Asia_Kolkata-local-date-time-h7.txt create mode 100644 date-time/output/02-dst-h2-Asia_Kolkata-local-date-time-h8.txt create mode 100644 date-time/output/02-dst-postgres-America_New_York-local-date-time-directfalse-h8.txt create mode 100644 date-time/output/02-dst-postgres-America_New_York-local-date-time-directtrue-h7.txt create mode 100644 date-time/output/02-dst-postgres-America_New_York-local-date-time-h7.txt create mode 100644 date-time/output/02-dst-postgres-America_New_York-local-date-time-h8.txt create mode 100644 date-time/output/02-dst-postgres-Asia_Kolkata-local-date-time-h7.txt create mode 100644 date-time/output/02-dst-postgres-Asia_Kolkata-local-date-time-h8.txt create mode 100644 date-time/output/03-precision-h2-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/03-precision-h2-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/03-precision-h2-America_New_York-h7.txt create mode 100644 date-time/output/03-precision-h2-America_New_York-h8.txt create mode 100644 date-time/output/03-precision-h2-Asia_Kolkata-h7.txt create mode 100644 date-time/output/03-precision-h2-Asia_Kolkata-h8.txt create mode 100644 date-time/output/03-precision-hsqldb-Asia_Kolkata-h7.txt create mode 100644 date-time/output/03-precision-postgres-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/03-precision-postgres-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/03-precision-postgres-America_New_York-h7.txt create mode 100644 date-time/output/03-precision-postgres-America_New_York-h8.txt create mode 100644 date-time/output/03-precision-postgres-Asia_Kolkata-h7.txt create mode 100644 date-time/output/03-precision-postgres-Asia_Kolkata-h8.txt create mode 100644 date-time/output/04-zoned-failure-postgres-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/04-zoned-h2-America_New_York-same-jvm-directfalse-h8.txt create mode 100644 date-time/output/04-zoned-h2-America_New_York-same-jvm-directtrue-h7.txt create mode 100644 date-time/output/04-zoned-h2-America_New_York-same-jvm-h7.txt create mode 100644 date-time/output/04-zoned-h2-America_New_York-same-jvm-h8.txt create mode 100644 date-time/output/04-zoned-h2-America_New_York-written-in-Asia_Kolkata-h7.txt create mode 100644 date-time/output/04-zoned-h2-Asia_Kolkata-same-jvm-h7.txt create mode 100644 date-time/output/04-zoned-h2-Asia_Kolkata-same-jvm-h8.txt create mode 100644 date-time/output/04-zoned-h2-Asia_Kolkata-written-in-America_New_York-h7.txt create mode 100644 date-time/output/04-zoned-postgres-America_New_York-same-jvm-directfalse-h8.txt create mode 100644 date-time/output/04-zoned-postgres-America_New_York-same-jvm-h7.txt create mode 100644 date-time/output/04-zoned-postgres-America_New_York-same-jvm-h8.txt create mode 100644 date-time/output/04-zoned-postgres-America_New_York-written-in-Asia_Kolkata-h7.txt create mode 100644 date-time/output/04-zoned-postgres-Asia_Kolkata-same-jvm-h7.txt create mode 100644 date-time/output/04-zoned-postgres-Asia_Kolkata-same-jvm-h8.txt create mode 100644 date-time/output/04-zoned-postgres-Asia_Kolkata-written-in-America_New_York-h7.txt create mode 100644 date-time/output/05-ddl-h2-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/05-ddl-h2-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/05-ddl-h2-America_New_York-h7.txt create mode 100644 date-time/output/05-ddl-h2-America_New_York-h8.txt create mode 100644 date-time/output/05-ddl-h2-Asia_Kolkata-h7.txt create mode 100644 date-time/output/05-ddl-h2-Asia_Kolkata-h8.txt create mode 100644 date-time/output/05-ddl-postgres-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/05-ddl-postgres-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/05-ddl-postgres-America_New_York-h7.txt create mode 100644 date-time/output/05-ddl-postgres-America_New_York-h8.txt create mode 100644 date-time/output/05-ddl-postgres-Asia_Kolkata-h7.txt create mode 100644 date-time/output/05-ddl-postgres-Asia_Kolkata-h8.txt create mode 100644 date-time/output/06-jdbc-time-zone-h2-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/06-jdbc-time-zone-h2-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/06-jdbc-time-zone-h2-America_New_York-h7.txt create mode 100644 date-time/output/06-jdbc-time-zone-h2-America_New_York-h8.txt create mode 100644 date-time/output/06-jdbc-time-zone-h2-Asia_Kolkata-h7.txt create mode 100644 date-time/output/06-jdbc-time-zone-h2-Asia_Kolkata-h8.txt create mode 100644 date-time/output/06-jdbc-time-zone-postgres-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/06-jdbc-time-zone-postgres-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/06-jdbc-time-zone-postgres-America_New_York-h7.txt create mode 100644 date-time/output/06-jdbc-time-zone-postgres-America_New_York-h8.txt create mode 100644 date-time/output/06-jdbc-time-zone-postgres-Asia_Kolkata-h7.txt create mode 100644 date-time/output/06-jdbc-time-zone-postgres-Asia_Kolkata-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-directfalse-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-directtrue-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-directfalse-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-directtrue-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp_utc-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp_utc-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-directfalse-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-directtrue-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-directfalse-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-directtrue-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp-h8.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp_utc-h7.txt create mode 100644 date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp_utc-h8.txt create mode 100644 date-time/output/08-column-precision-h2-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/08-column-precision-h2-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/08-column-precision-h2-America_New_York-h7.txt create mode 100644 date-time/output/08-column-precision-h2-America_New_York-h8.txt create mode 100644 date-time/output/08-column-precision-h2-Asia_Kolkata-h7.txt create mode 100644 date-time/output/08-column-precision-h2-Asia_Kolkata-h8.txt create mode 100644 date-time/output/08-column-precision-postgres-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/08-column-precision-postgres-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/08-column-precision-postgres-America_New_York-h7.txt create mode 100644 date-time/output/08-column-precision-postgres-America_New_York-h8.txt create mode 100644 date-time/output/08-column-precision-postgres-Asia_Kolkata-h7.txt create mode 100644 date-time/output/08-column-precision-postgres-Asia_Kolkata-h8.txt create mode 100644 date-time/output/09-legacy-types-h2-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/09-legacy-types-h2-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/09-legacy-types-h2-America_New_York-h7.txt create mode 100644 date-time/output/09-legacy-types-h2-America_New_York-h8.txt create mode 100644 date-time/output/09-legacy-types-h2-Asia_Kolkata-h7.txt create mode 100644 date-time/output/09-legacy-types-h2-Asia_Kolkata-h8.txt create mode 100644 date-time/output/09-legacy-types-postgres-America_New_York-directfalse-h8.txt create mode 100644 date-time/output/09-legacy-types-postgres-America_New_York-directtrue-h7.txt create mode 100644 date-time/output/09-legacy-types-postgres-America_New_York-h7.txt create mode 100644 date-time/output/09-legacy-types-postgres-America_New_York-h8.txt create mode 100644 date-time/output/09-legacy-types-postgres-Asia_Kolkata-h7.txt create mode 100644 date-time/output/09-legacy-types-postgres-Asia_Kolkata-h8.txt create mode 100644 date-time/output/10-javap-hibernate-settings.txt create mode 100644 date-time/output/10-javap-jakarta-persistence.txt create mode 100644 date-time/pom.xml create mode 100755 date-time/scripts/javap-facts.sh create mode 100755 date-time/scripts/run-all.sh create mode 100644 date-time/src/main/java/com/ankurm/datetime/Db.java create mode 100644 date-time/src/main/java/com/ankurm/datetime/Event.java create mode 100644 date-time/src/main/java/com/ankurm/datetime/Legacy.java create mode 100644 date-time/src/main/java/com/ankurm/datetime/PrecisionEvent.java create mode 100644 date-time/src/main/java/com/ankurm/datetime/Probe.java create mode 100644 date-time/src/main/java/com/ankurm/datetime/ZonedEvent.java create mode 100644 date-time/src/test/java/com/ankurm/datetime/EdgeCasesTest.java create mode 100644 date-time/src/test/java/com/ankurm/datetime/JdbcTimeZoneTest.java create mode 100644 date-time/src/test/java/com/ankurm/datetime/RoundTripTest.java create mode 100644 date-time/src/test/java/com/ankurm/datetime/Transcript.java create mode 100644 date-time/src/test/java/com/ankurm/datetime/TypesTest.java create mode 100644 date-time/src/test/java/com/ankurm/datetime/ZonedTest.java diff --git a/README.md b/README.md index ea39bd1..2d15ffb 100755 --- a/README.md +++ b/README.md @@ -341,6 +341,7 @@ Modules with their own `pom.xml` that run plain Hibernate without the Spring Boo | Module | What it covers | |---|---| +| [`date-time`](date-time/) | `Instant` vs `LocalDateTime` vs `OffsetDateTime` vs `ZonedDateTime` round-tripped across JVM time zones on H2 and PostgreSQL: what survives, `@TimeZoneStorage`, DST gaps, precision, and the Hibernate 8 `java_time_use_direct_jdbc` default (Hibernate `7.4.14.Final`, Hibernate `8.0.0.Beta4` preview) | | [`h8-preview`](h8-preview/) | Hibernate ORM 8 beta against Hibernate 7: what breaks | | [`inheritance`](inheritance/) | `SINGLE_TABLE` vs `JOINED` vs `TABLE_PER_CLASS` vs `@MappedSuperclass`: generated DDL, SQL, failures and timings (Hibernate `7.4.13.Final`) | | [`locking`](locking/) | Optimistic (`@Version`, retries) vs pessimistic (`PESSIMISTIC_WRITE`, `NOWAIT`, `SKIP LOCKED`) locking, lost updates and deadlocks on H2 (Hibernate `7.4.14.Final`) | diff --git a/date-time/README.md b/date-time/README.md new file mode 100644 index 0000000..f7322f5 --- /dev/null +++ b/date-time/README.md @@ -0,0 +1,71 @@ +# date-time + +Companion module for the ankurm.com article **Hibernate 7 Date and Time Mapping: Instant vs LocalDateTime vs +OffsetDateTime (What Round-Trips)**. Plain Hibernate (no Spring). One moment is written into every `java.time` +column, then read back in a new session, in a JVM with a different default time zone, on two databases. +Each test writes what it observed to `output/` and asserts the same facts. + +This module supersedes the date/time experiments in the main project's +[`docs/13-date-and-time-mapping.md`](../docs/13-date-and-time-mapping.md) (Hibernate 7.4.5, H2 and HSQLDB only, +every run inside one JVM zone). Chapter 13 is left as it was; where this module disagrees with it, this module is newer. + +## Versions + +| Component | Version | Notes | +|---|---|---| +| Hibernate ORM | `7.4.14.Final` | latest 7.x GA on Maven Central on 2026-10-28 | +| Hibernate ORM (preview run) | `8.0.0.Beta4` | pre-release, published 2026-10-28; `-Dhibernate.version=8.0.0.Beta4 -Dpersistence.version=4.0.0-M7 -Dh.label=h8` | +| Jakarta Persistence | `3.2.0` (`4.0.0-M7` for the Hibernate 8 run) | | +| H2 | `2.5.252` | file database, so a second JVM can read what the first wrote | +| PostgreSQL | `17.11` (`postgres:17-alpine` in Docker), driver `org.postgresql:postgresql:42.7.14` | server `TimeZone` is `UTC`; see `output/00-environment.txt` | +| HSQLDB | `2.7.4` | only the precision comparison | +| JUnit Jupiter / AssertJ | `6.0.3` / `3.27.7` | | +| Java | `25` (Temurin 25.0.5+8) | | + +## Run + +```bash +./scripts/run-all.sh # whole matrix; needs Docker for PostgreSQL. H7_ONLY=1 skips the Hibernate 8 beta runs +mvn test # H2 only, in your JVM's own time zone +mvn test -Ddt.jvmargs=-Duser.timezone=America/New_York +``` + +`run-all.sh` runs the suite for each database in JVM zones `Asia/Kolkata` (+05:30, no DST) and +`America/New_York` (DST), then a **cross-zone** pass (write in one JVM zone, read in a JVM with the other), then +`hibernate.type.java_time_use_direct_jdbc=true` on Hibernate 7, then the Hibernate 8 beta with its default and with +the flag set back to `false`. + +## Output + +File names are `NN-topic--[-variant][-directtrue|-directfalse]-.txt`. The header of every file states the +Hibernate version, database version, JVM zone and the effective `java_time_use_direct_jdbc`. `directtrue` / `directfalse` +mean the flag was set explicitly; no suffix means that Hibernate line's default (`false` on 7.4, `true` on 8.0.0.Beta4). + +| Prefix | What it shows | +|---|---| +| `00-environment` | JDK, PostgreSQL server and image digest, drivers | +| `01-roundtrip` | one moment in `Instant`, `LocalDateTime`, `OffsetDateTime` (default, `NATIVE`, `NORMALIZE`, `NORMALIZE_UTC`, `COLUMN`): in, out, equal?, same instant?, raw column text. `same-jvm` or `written-in-` (cross-zone) | +| `02-dst` | a `LocalDateTime` inside New York's spring-forward gap and one inside the fall-back overlap | +| `03-precision` | nanoseconds written, what comes back (H2, PostgreSQL, HSQLDB) | +| `04-zoned` / `04-zoned-failure` | `ZonedDateTime` round trip; the PostgreSQL + direct JDBC bind and read failure on Hibernate 7.4 | +| `05-ddl` | column types Hibernate generated, from `information_schema` | +| `06-jdbc-time-zone` | `hibernate.jdbc.time_zone` set to the zone the JVM is not in | +| `07-preferred-instant-jdbc-type` | `TIMESTAMP` vs `TIMESTAMP_UTC` for `Instant` | +| `08-column-precision` | `@Column(precision)` vs `@Column(secondPrecision)` | +| `09-legacy-types` | `java.util.Date` without `@Temporal`, `Year`, `YearMonth`, `Duration` | +| `10-javap-*` | enum constants, setting names and `@Temporal` deprecation read from the jars | + +## Sources + +| File | Role | +|---|---| +| `src/main/java/com/ankurm/datetime/Event.java` | the entity with one column per mapping | +| `src/main/java/com/ankurm/datetime/ZonedEvent.java` | `ZonedDateTime` on its own entity (it cannot be bound on one driver setting) | +| `src/main/java/com/ankurm/datetime/Probe.java`, `PrecisionEvent.java`, `Legacy.java` | narrow entities for the edge cases | +| `src/main/java/com/ankurm/datetime/Db.java` | builds the `SessionFactory` for H2 / PostgreSQL / HSQLDB from system properties | +| `src/test/java/com/ankurm/datetime/RoundTripTest.java` | the round trip, same-JVM and cross-zone | +| `src/test/java/com/ankurm/datetime/EdgeCasesTest.java` | DST gap and overlap, precision, generated DDL | +| `src/test/java/com/ankurm/datetime/ZonedTest.java`, `JdbcTimeZoneTest.java`, `TypesTest.java` | the rest | + +This module has its own `pom.xml` and does not use the Spring Boot parent of the main `hibernate-demo` project. The +Hibernate 8 results are from a beta and can change before 8.0 final. diff --git a/date-time/output/00-environment.txt b/date-time/output/00-environment.txt new file mode 100644 index 0000000..75cb354 --- /dev/null +++ b/date-time/output/00-environment.txt @@ -0,0 +1,8 @@ +# environment for this run of scripts/run-all.sh +openjdk version "25.0.5" 2026-10-20 LTS +OpenJDK Runtime Environment Temurin-25.0.5+8 (build 25.0.5+8-LTS) +OpenJDK 64-Bit Server VM Temurin-25.0.5+8 (build 25.0.5+8-LTS, mixed mode, sharing) +postgres server: PostgreSQL 17.11 on x86_64-pc-linux-musl, compiled by gcc (Alpine 15.2.0) 15.2.0, 64-bit +postgres image: postgres@sha256:266d3c257594e195b309ae9d1805e54c788f1d7b375f56bf6c367aac6c917e7b +postgres server TimeZone setting: UTC +jdbc drivers: org.postgresql:postgresql:42.7.14, com.h2database:h2:2.5.252, org.hsqldb:hsqldb:2.7.4 diff --git a/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-directfalse-h8.txt b/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-directfalse-h8.txt new file mode 100644 index 0000000..11be9d8 --- /dev/null +++ b/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-directfalse-h8.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 08:30:00+00 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T04:30-04:00 | equals false | same instant true | raw 2026-06-15 04:30:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 08:30:00+00 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-directtrue-h7.txt b/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-directtrue-h7.txt new file mode 100644 index 0000000..8589b22 --- /dev/null +++ b/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-directtrue-h7.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 08:30:00+00 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-h7.txt b/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-h7.txt new file mode 100644 index 0000000..5fa60c4 --- /dev/null +++ b/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-h7.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 08:30:00+00 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T04:30-04:00 | equals false | same instant true | raw 2026-06-15 04:30:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 08:30:00+00 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-h8.txt b/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-h8.txt new file mode 100644 index 0000000..6a10fcc --- /dev/null +++ b/date-time/output/01-roundtrip-h2-America_New_York-same-jvm-h8.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 08:30:00+00 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/01-roundtrip-h2-America_New_York-written-in-Asia_Kolkata-h7.txt b/date-time/output/01-roundtrip-h2-America_New_York-written-in-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..deffe0f --- /dev/null +++ b/date-time/output/01-roundtrip-h2-America_New_York-written-in-Asia_Kolkata-h7.txt @@ -0,0 +1,11 @@ +# 01-roundtrip (written-in-Asia_Kolkata) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written by another JVM whose default zone was Asia/Kolkata; this JVM only reads (see scripts/run-all.sh) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 08:30:00+00 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T14:00-04:00 | equals false | same instant false | raw 2026-06-15 14:00:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 08:30:00+00 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/01-roundtrip-h2-Asia_Kolkata-same-jvm-h7.txt b/date-time/output/01-roundtrip-h2-Asia_Kolkata-same-jvm-h7.txt new file mode 100644 index 0000000..644425c --- /dev/null +++ b/date-time/output/01-roundtrip-h2-Asia_Kolkata-same-jvm-h7.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 08:30:00+00 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 08:30:00+00 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/01-roundtrip-h2-Asia_Kolkata-same-jvm-h8.txt b/date-time/output/01-roundtrip-h2-Asia_Kolkata-same-jvm-h8.txt new file mode 100644 index 0000000..fb145e9 --- /dev/null +++ b/date-time/output/01-roundtrip-h2-Asia_Kolkata-same-jvm-h8.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 08:30:00+00 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/01-roundtrip-h2-Asia_Kolkata-written-in-America_New_York-h7.txt b/date-time/output/01-roundtrip-h2-Asia_Kolkata-written-in-America_New_York-h7.txt new file mode 100644 index 0000000..8a9b34c --- /dev/null +++ b/date-time/output/01-roundtrip-h2-Asia_Kolkata-written-in-America_New_York-h7.txt @@ -0,0 +1,11 @@ +# 01-roundtrip (written-in-America_New_York) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written by another JVM whose default zone was America/New_York; this JVM only reads (see scripts/run-all.sh) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 08:30:00+00 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T04:30+05:30 | equals false | same instant false | raw 2026-06-15 04:30:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 08:30:00+00 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-directfalse-h8.txt b/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-directfalse-h8.txt new file mode 100644 index 0000000..12a4497 --- /dev/null +++ b/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-directfalse-h8.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 04:30:00-04 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NATIVE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NORMALIZE out 2026-06-15T04:30-04:00 | equals false | same instant true | raw 2026-06-15 04:30:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-directtrue-h7.txt b/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-directtrue-h7.txt new file mode 100644 index 0000000..358e5c2 --- /dev/null +++ b/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-directtrue-h7.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 04:30:00-04 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NATIVE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NORMALIZE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-h7.txt b/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-h7.txt new file mode 100644 index 0000000..abc08e6 --- /dev/null +++ b/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-h7.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 04:30:00-04 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NATIVE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NORMALIZE out 2026-06-15T04:30-04:00 | equals false | same instant true | raw 2026-06-15 04:30:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-h8.txt b/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-h8.txt new file mode 100644 index 0000000..b646c4d --- /dev/null +++ b/date-time/output/01-roundtrip-postgres-America_New_York-same-jvm-h8.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 04:30:00-04 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NATIVE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NORMALIZE out 2026-06-15T04:30-04:00 | equals false | same instant true | raw 2026-06-15 04:30:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/01-roundtrip-postgres-America_New_York-written-in-Asia_Kolkata-h7.txt b/date-time/output/01-roundtrip-postgres-America_New_York-written-in-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..8adb677 --- /dev/null +++ b/date-time/output/01-roundtrip-postgres-America_New_York-written-in-Asia_Kolkata-h7.txt @@ -0,0 +1,11 @@ +# 01-roundtrip (written-in-Asia_Kolkata) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written by another JVM whose default zone was Asia/Kolkata; this JVM only reads (see scripts/run-all.sh) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 04:30:00-04 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NATIVE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime NORMALIZE out 2026-06-15T14:00-04:00 | equals false | same instant false | raw 2026-06-15 14:00:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 04:30:00-04 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/01-roundtrip-postgres-Asia_Kolkata-same-jvm-h7.txt b/date-time/output/01-roundtrip-postgres-Asia_Kolkata-same-jvm-h7.txt new file mode 100644 index 0000000..dcac898 --- /dev/null +++ b/date-time/output/01-roundtrip-postgres-Asia_Kolkata-same-jvm-h7.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 diff --git a/date-time/output/01-roundtrip-postgres-Asia_Kolkata-same-jvm-h8.txt b/date-time/output/01-roundtrip-postgres-Asia_Kolkata-same-jvm-h8.txt new file mode 100644 index 0000000..554db38 --- /dev/null +++ b/date-time/output/01-roundtrip-postgres-Asia_Kolkata-same-jvm-h8.txt @@ -0,0 +1,10 @@ +# 01-roundtrip (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 diff --git a/date-time/output/01-roundtrip-postgres-Asia_Kolkata-written-in-America_New_York-h7.txt b/date-time/output/01-roundtrip-postgres-Asia_Kolkata-written-in-America_New_York-h7.txt new file mode 100644 index 0000000..0a3de4c --- /dev/null +++ b/date-time/output/01-roundtrip-postgres-Asia_Kolkata-written-in-America_New_York-h7.txt @@ -0,0 +1,11 @@ +# 01-roundtrip (written-in-America_New_York) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written by another JVM whose default zone was America/New_York; this JVM only reads (see scripts/run-all.sh) +# written: Instant 2026-06-15T08:30:00Z, LocalDateTime 2026-06-15T14:00, OffsetDateTime 2026-06-15T14:00+05:30 (all the same moment; the LocalDateTime is the Kolkata wall clock) +Instant out 2026-06-15T08:30:00Z | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 +LocalDateTime out 2026-06-15T14:00 | equals true | same instant n/a | raw 2026-06-15 14:00:00 +OffsetDateTime default out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NATIVE out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime NORMALIZE out 2026-06-15T04:30+05:30 | equals false | same instant false | raw 2026-06-15 04:30:00 +OffsetDateTime NORMALIZE_UTC out 2026-06-15T08:30Z | equals false | same instant true | raw 2026-06-15 14:00:00+05:30 +OffsetDateTime COLUMN out 2026-06-15T14:00+05:30 | equals true | same instant true | raw 2026-06-15 14:00:00+05:30 diff --git a/date-time/output/02-dst-h2-America_New_York-local-date-time-directfalse-h8.txt b/date-time/output/02-dst-h2-America_New_York-local-date-time-directfalse-h8.txt new file mode 100644 index 0000000..418496c --- /dev/null +++ b/date-time/output/02-dst-h2-America_New_York-local-date-time-directfalse-h8.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T03:30 | equals false | raw 2026-03-08 03:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-h2-America_New_York-local-date-time-directtrue-h7.txt b/date-time/output/02-dst-h2-America_New_York-local-date-time-directtrue-h7.txt new file mode 100644 index 0000000..39ac704 --- /dev/null +++ b/date-time/output/02-dst-h2-America_New_York-local-date-time-directtrue-h7.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T02:30 | equals true | raw 2026-03-08 02:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-h2-America_New_York-local-date-time-h7.txt b/date-time/output/02-dst-h2-America_New_York-local-date-time-h7.txt new file mode 100644 index 0000000..0e0e3fd --- /dev/null +++ b/date-time/output/02-dst-h2-America_New_York-local-date-time-h7.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T03:30 | equals false | raw 2026-03-08 03:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-h2-America_New_York-local-date-time-h8.txt b/date-time/output/02-dst-h2-America_New_York-local-date-time-h8.txt new file mode 100644 index 0000000..861c22e --- /dev/null +++ b/date-time/output/02-dst-h2-America_New_York-local-date-time-h8.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T02:30 | equals true | raw 2026-03-08 02:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-h2-Asia_Kolkata-local-date-time-h7.txt b/date-time/output/02-dst-h2-Asia_Kolkata-local-date-time-h7.txt new file mode 100644 index 0000000..e5e337f --- /dev/null +++ b/date-time/output/02-dst-h2-Asia_Kolkata-local-date-time-h7.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T02:30 | equals true | raw 2026-03-08 02:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-h2-Asia_Kolkata-local-date-time-h8.txt b/date-time/output/02-dst-h2-Asia_Kolkata-local-date-time-h8.txt new file mode 100644 index 0000000..d9a20f7 --- /dev/null +++ b/date-time/output/02-dst-h2-Asia_Kolkata-local-date-time-h8.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T02:30 | equals true | raw 2026-03-08 02:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-postgres-America_New_York-local-date-time-directfalse-h8.txt b/date-time/output/02-dst-postgres-America_New_York-local-date-time-directfalse-h8.txt new file mode 100644 index 0000000..a0d03fc --- /dev/null +++ b/date-time/output/02-dst-postgres-America_New_York-local-date-time-directfalse-h8.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T03:30 | equals false | raw 2026-03-08 03:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-postgres-America_New_York-local-date-time-directtrue-h7.txt b/date-time/output/02-dst-postgres-America_New_York-local-date-time-directtrue-h7.txt new file mode 100644 index 0000000..aa4f8a8 --- /dev/null +++ b/date-time/output/02-dst-postgres-America_New_York-local-date-time-directtrue-h7.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T02:30 | equals true | raw 2026-03-08 02:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-postgres-America_New_York-local-date-time-h7.txt b/date-time/output/02-dst-postgres-America_New_York-local-date-time-h7.txt new file mode 100644 index 0000000..e1d2d46 --- /dev/null +++ b/date-time/output/02-dst-postgres-America_New_York-local-date-time-h7.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T03:30 | equals false | raw 2026-03-08 03:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-postgres-America_New_York-local-date-time-h8.txt b/date-time/output/02-dst-postgres-America_New_York-local-date-time-h8.txt new file mode 100644 index 0000000..e72cc1e --- /dev/null +++ b/date-time/output/02-dst-postgres-America_New_York-local-date-time-h8.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T02:30 | equals true | raw 2026-03-08 02:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-postgres-Asia_Kolkata-local-date-time-h7.txt b/date-time/output/02-dst-postgres-Asia_Kolkata-local-date-time-h7.txt new file mode 100644 index 0000000..12db019 --- /dev/null +++ b/date-time/output/02-dst-postgres-Asia_Kolkata-local-date-time-h7.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T02:30 | equals true | raw 2026-03-08 02:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/02-dst-postgres-Asia_Kolkata-local-date-time-h8.txt b/date-time/output/02-dst-postgres-Asia_Kolkata-local-date-time-h8.txt new file mode 100644 index 0000000..6f078b9 --- /dev/null +++ b/date-time/output/02-dst-postgres-Asia_Kolkata-local-date-time-h8.txt @@ -0,0 +1,6 @@ +# 02-dst (local-date-time) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00 +plain wall clock in 2026-06-15T14:00 | out 2026-06-15T14:00 | equals true | raw 2026-06-15 14:00:00 +gap 02:30 on 2026-03-08 in 2026-03-08T02:30 | out 2026-03-08T02:30 | equals true | raw 2026-03-08 02:30:00 +overlap 01:30 on 2026-11-01 in 2026-11-01T01:30 | out 2026-11-01T01:30 | equals true | raw 2026-11-01 01:30:00 diff --git a/date-time/output/03-precision-h2-America_New_York-directfalse-h8.txt b/date-time/output/03-precision-h2-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..539a3b4 --- /dev/null +++ b/date-time/output/03-precision-h2-America_New_York-directfalse-h8.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T14:00:01+05:30 +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T14:00:00.123456+05:30 diff --git a/date-time/output/03-precision-h2-America_New_York-directtrue-h7.txt b/date-time/output/03-precision-h2-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..953d496 --- /dev/null +++ b/date-time/output/03-precision-h2-America_New_York-directtrue-h7.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T14:00:01+05:30 +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T14:00:00.123456+05:30 diff --git a/date-time/output/03-precision-h2-America_New_York-h7.txt b/date-time/output/03-precision-h2-America_New_York-h7.txt new file mode 100644 index 0000000..36929e5 --- /dev/null +++ b/date-time/output/03-precision-h2-America_New_York-h7.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T14:00:01+05:30 +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T14:00:00.123456+05:30 diff --git a/date-time/output/03-precision-h2-America_New_York-h8.txt b/date-time/output/03-precision-h2-America_New_York-h8.txt new file mode 100644 index 0000000..3eee455 --- /dev/null +++ b/date-time/output/03-precision-h2-America_New_York-h8.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T14:00:01+05:30 +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T14:00:00.123456+05:30 diff --git a/date-time/output/03-precision-h2-Asia_Kolkata-h7.txt b/date-time/output/03-precision-h2-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..b16bc98 --- /dev/null +++ b/date-time/output/03-precision-h2-Asia_Kolkata-h7.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T14:00:01+05:30 +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T14:00:00.123456+05:30 diff --git a/date-time/output/03-precision-h2-Asia_Kolkata-h8.txt b/date-time/output/03-precision-h2-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..9328fb8 --- /dev/null +++ b/date-time/output/03-precision-h2-Asia_Kolkata-h8.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T14:00:00.123457+05:30 +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T14:00:01+05:30 +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T14:00:00.123456+05:30 diff --git a/date-time/output/03-precision-hsqldb-Asia_Kolkata-h7.txt b/date-time/output/03-precision-hsqldb-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..c961b64 --- /dev/null +++ b/date-time/output/03-precision-hsqldb-Asia_Kolkata-h7.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database HSQL Database Engine 2.7.4, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:00.999999 | Instant 2026-06-15T08:30:00.999999Z | OffsetDateTime 2026-06-15T08:30:00.999999Z +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z diff --git a/date-time/output/03-precision-postgres-America_New_York-directfalse-h8.txt b/date-time/output/03-precision-postgres-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..f7d6ff7 --- /dev/null +++ b/date-time/output/03-precision-postgres-America_New_York-directfalse-h8.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T08:30:01Z +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z diff --git a/date-time/output/03-precision-postgres-America_New_York-directtrue-h7.txt b/date-time/output/03-precision-postgres-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..d1bddbd --- /dev/null +++ b/date-time/output/03-precision-postgres-America_New_York-directtrue-h7.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T08:30:01Z +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z diff --git a/date-time/output/03-precision-postgres-America_New_York-h7.txt b/date-time/output/03-precision-postgres-America_New_York-h7.txt new file mode 100644 index 0000000..e4b92ca --- /dev/null +++ b/date-time/output/03-precision-postgres-America_New_York-h7.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T08:30:01Z +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z diff --git a/date-time/output/03-precision-postgres-America_New_York-h8.txt b/date-time/output/03-precision-postgres-America_New_York-h8.txt new file mode 100644 index 0000000..e508a56 --- /dev/null +++ b/date-time/output/03-precision-postgres-America_New_York-h8.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T08:30:01Z +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z diff --git a/date-time/output/03-precision-postgres-Asia_Kolkata-h7.txt b/date-time/output/03-precision-postgres-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..dbbd527 --- /dev/null +++ b/date-time/output/03-precision-postgres-Asia_Kolkata-h7.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T08:30:01Z +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z diff --git a/date-time/output/03-precision-postgres-Asia_Kolkata-h8.txt b/date-time/output/03-precision-postgres-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..df10c14 --- /dev/null +++ b/date-time/output/03-precision-postgres-Asia_Kolkata-h8.txt @@ -0,0 +1,7 @@ +# 03-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6)) +nanos .123456789 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .123456500 -> LocalDateTime 2026-06-15T14:00:00.123457 | Instant 2026-06-15T08:30:00.123457Z | OffsetDateTime 2026-06-15T08:30:00.123457Z +nanos .999999999 -> LocalDateTime 2026-06-15T14:00:01 | Instant 2026-06-15T08:30:01Z | OffsetDateTime 2026-06-15T08:30:01Z +nanos .123456499 -> LocalDateTime 2026-06-15T14:00:00.123456 | Instant 2026-06-15T08:30:00.123456Z | OffsetDateTime 2026-06-15T08:30:00.123456Z diff --git a/date-time/output/04-zoned-failure-postgres-America_New_York-directtrue-h7.txt b/date-time/output/04-zoned-failure-postgres-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..e0e9755 --- /dev/null +++ b/date-time/output/04-zoned-failure-postgres-America_New_York-directtrue-h7.txt @@ -0,0 +1,9 @@ +# 04-zoned-failure +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# ZonedDateTime on PostgreSQL with java_time_use_direct_jdbc=true +## persist(new ZonedEvent(zonedDefault = 2026-06-15T10:30+02:00[Europe/Paris])) +org.hibernate.exception.SQLGrammarException: Unable to bind parameter #3 - 2026-06-15T10:30+02:00[Europe/Paris] [Cannot cast an instance of java.time.ZonedDateTime to type Types.TIMESTAMP_WITH_TIMEZONE] [n/a] +org.postgresql.util.PSQLException: Cannot cast an instance of java.time.ZonedDateTime to type Types.TIMESTAMP_WITH_TIMEZONE +## find(ZonedEvent.class, 2) -- a row whose ZonedDateTime columns are NULL +org.hibernate.exception.DataException: Could not extract column [4] from JDBC ResultSet [conversion to class java.time.ZonedDateTime from timestamptz not supported] [n/a] +org.postgresql.util.PSQLException: conversion to class java.time.ZonedDateTime from timestamptz not supported diff --git a/date-time/output/04-zoned-h2-America_New_York-same-jvm-directfalse-h8.txt b/date-time/output/04-zoned-h2-America_New_York-same-jvm-directfalse-h8.txt new file mode 100644 index 0000000..ce7e5d3 --- /dev/null +++ b/date-time/output/04-zoned-h2-America_New_York-same-jvm-directfalse-h8.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 10:30:00+02 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/04-zoned-h2-America_New_York-same-jvm-directtrue-h7.txt b/date-time/output/04-zoned-h2-America_New_York-same-jvm-directtrue-h7.txt new file mode 100644 index 0000000..6b2c627 --- /dev/null +++ b/date-time/output/04-zoned-h2-America_New_York-same-jvm-directtrue-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 10:30:00+02 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/04-zoned-h2-America_New_York-same-jvm-h7.txt b/date-time/output/04-zoned-h2-America_New_York-same-jvm-h7.txt new file mode 100644 index 0000000..c98d3a9 --- /dev/null +++ b/date-time/output/04-zoned-h2-America_New_York-same-jvm-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 10:30:00+02 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/04-zoned-h2-America_New_York-same-jvm-h8.txt b/date-time/output/04-zoned-h2-America_New_York-same-jvm-h8.txt new file mode 100644 index 0000000..e75593f --- /dev/null +++ b/date-time/output/04-zoned-h2-America_New_York-same-jvm-h8.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 10:30:00+02 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/04-zoned-h2-America_New_York-written-in-Asia_Kolkata-h7.txt b/date-time/output/04-zoned-h2-America_New_York-written-in-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..c4d345f --- /dev/null +++ b/date-time/output/04-zoned-h2-America_New_York-written-in-Asia_Kolkata-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (written-in-Asia_Kolkata) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 10:30:00+02 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/04-zoned-h2-Asia_Kolkata-same-jvm-h7.txt b/date-time/output/04-zoned-h2-Asia_Kolkata-same-jvm-h7.txt new file mode 100644 index 0000000..c235d96 --- /dev/null +++ b/date-time/output/04-zoned-h2-Asia_Kolkata-same-jvm-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 10:30:00+02 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/04-zoned-h2-Asia_Kolkata-same-jvm-h8.txt b/date-time/output/04-zoned-h2-Asia_Kolkata-same-jvm-h8.txt new file mode 100644 index 0000000..6dd894c --- /dev/null +++ b/date-time/output/04-zoned-h2-Asia_Kolkata-same-jvm-h8.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 10:30:00+02 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/04-zoned-h2-Asia_Kolkata-written-in-America_New_York-h7.txt b/date-time/output/04-zoned-h2-Asia_Kolkata-written-in-America_New_York-h7.txt new file mode 100644 index 0000000..22162d9 --- /dev/null +++ b/date-time/output/04-zoned-h2-Asia_Kolkata-written-in-America_New_York-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (written-in-America_New_York) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 10:30:00+02 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 08:30:00+00 diff --git a/date-time/output/04-zoned-postgres-America_New_York-same-jvm-directfalse-h8.txt b/date-time/output/04-zoned-postgres-America_New_York-same-jvm-directfalse-h8.txt new file mode 100644 index 0000000..b2a534a --- /dev/null +++ b/date-time/output/04-zoned-postgres-America_New_York-same-jvm-directfalse-h8.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T08:30Z | equals false | same instant true | zone Z | raw 2026-06-15 04:30:00-04 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/04-zoned-postgres-America_New_York-same-jvm-h7.txt b/date-time/output/04-zoned-postgres-America_New_York-same-jvm-h7.txt new file mode 100644 index 0000000..7e48781 --- /dev/null +++ b/date-time/output/04-zoned-postgres-America_New_York-same-jvm-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T08:30Z | equals false | same instant true | zone Z | raw 2026-06-15 04:30:00-04 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/04-zoned-postgres-America_New_York-same-jvm-h8.txt b/date-time/output/04-zoned-postgres-America_New_York-same-jvm-h8.txt new file mode 100644 index 0000000..317a23f --- /dev/null +++ b/date-time/output/04-zoned-postgres-America_New_York-same-jvm-h8.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T08:30Z | equals false | same instant true | zone Z | raw 2026-06-15 04:30:00-04 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/04-zoned-postgres-America_New_York-written-in-Asia_Kolkata-h7.txt b/date-time/output/04-zoned-postgres-America_New_York-written-in-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..ab1a275 --- /dev/null +++ b/date-time/output/04-zoned-postgres-America_New_York-written-in-Asia_Kolkata-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (written-in-Asia_Kolkata) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T08:30Z | equals false | same instant true | zone Z | raw 2026-06-15 04:30:00-04 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 04:30:00-04 diff --git a/date-time/output/04-zoned-postgres-Asia_Kolkata-same-jvm-h7.txt b/date-time/output/04-zoned-postgres-Asia_Kolkata-same-jvm-h7.txt new file mode 100644 index 0000000..95d7dcc --- /dev/null +++ b/date-time/output/04-zoned-postgres-Asia_Kolkata-same-jvm-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T08:30Z | equals false | same instant true | zone Z | raw 2026-06-15 14:00:00+05:30 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 14:00:00+05:30 diff --git a/date-time/output/04-zoned-postgres-Asia_Kolkata-same-jvm-h8.txt b/date-time/output/04-zoned-postgres-Asia_Kolkata-same-jvm-h8.txt new file mode 100644 index 0000000..9088731 --- /dev/null +++ b/date-time/output/04-zoned-postgres-Asia_Kolkata-same-jvm-h8.txt @@ -0,0 +1,5 @@ +# 04-zoned (same-jvm) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T08:30Z | equals false | same instant true | zone Z | raw 2026-06-15 14:00:00+05:30 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 14:00:00+05:30 diff --git a/date-time/output/04-zoned-postgres-Asia_Kolkata-written-in-America_New_York-h7.txt b/date-time/output/04-zoned-postgres-Asia_Kolkata-written-in-America_New_York-h7.txt new file mode 100644 index 0000000..41ea5de --- /dev/null +++ b/date-time/output/04-zoned-postgres-Asia_Kolkata-written-in-America_New_York-h7.txt @@ -0,0 +1,5 @@ +# 04-zoned (written-in-America_New_York) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T10:30+02:00[Europe/Paris] (instant 2026-06-15T08:30:00Z) +ZonedDateTime default out 2026-06-15T08:30Z | equals false | same instant true | zone Z | raw 2026-06-15 14:00:00+05:30 +ZonedDateTime COLUMN out 2026-06-15T10:30+02:00 | equals false | same instant true | zone +02:00 | raw 2026-06-15 14:00:00+05:30 diff --git a/date-time/output/05-ddl-h2-America_New_York-directfalse-h8.txt b/date-time/output/05-ddl-h2-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..93127ea --- /dev/null +++ b/date-time/output/05-ddl-h2-America_New_York-directfalse-h8.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-h2-America_New_York-directtrue-h7.txt b/date-time/output/05-ddl-h2-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..59f5d35 --- /dev/null +++ b/date-time/output/05-ddl-h2-America_New_York-directtrue-h7.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp with time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-h2-America_New_York-h7.txt b/date-time/output/05-ddl-h2-America_New_York-h7.txt new file mode 100644 index 0000000..0f22b2b --- /dev/null +++ b/date-time/output/05-ddl-h2-America_New_York-h7.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-h2-America_New_York-h8.txt b/date-time/output/05-ddl-h2-America_New_York-h8.txt new file mode 100644 index 0000000..5f452d5 --- /dev/null +++ b/date-time/output/05-ddl-h2-America_New_York-h8.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp with time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-h2-Asia_Kolkata-h7.txt b/date-time/output/05-ddl-h2-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..10b6163 --- /dev/null +++ b/date-time/output/05-ddl-h2-Asia_Kolkata-h7.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-h2-Asia_Kolkata-h8.txt b/date-time/output/05-ddl-h2-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..c6c35ea --- /dev/null +++ b/date-time/output/05-ddl-h2-Asia_Kolkata-h8.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp with time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-postgres-America_New_York-directfalse-h8.txt b/date-time/output/05-ddl-postgres-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..fe02c49 --- /dev/null +++ b/date-time/output/05-ddl-postgres-America_New_York-directfalse-h8.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp without time zone precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp without time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-postgres-America_New_York-directtrue-h7.txt b/date-time/output/05-ddl-postgres-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..12b867a --- /dev/null +++ b/date-time/output/05-ddl-postgres-America_New_York-directtrue-h7.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp without time zone precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp with time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-postgres-America_New_York-h7.txt b/date-time/output/05-ddl-postgres-America_New_York-h7.txt new file mode 100644 index 0000000..1d7a577 --- /dev/null +++ b/date-time/output/05-ddl-postgres-America_New_York-h7.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp without time zone precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp without time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-postgres-America_New_York-h8.txt b/date-time/output/05-ddl-postgres-America_New_York-h8.txt new file mode 100644 index 0000000..a1b5b1b --- /dev/null +++ b/date-time/output/05-ddl-postgres-America_New_York-h8.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp without time zone precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp without time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-postgres-Asia_Kolkata-h7.txt b/date-time/output/05-ddl-postgres-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..f38814e --- /dev/null +++ b/date-time/output/05-ddl-postgres-Asia_Kolkata-h7.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp without time zone precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp without time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/05-ddl-postgres-Asia_Kolkata-h8.txt b/date-time/output/05-ddl-postgres-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..fc120e0 --- /dev/null +++ b/date-time/output/05-ddl-postgres-Asia_Kolkata-h8.txt @@ -0,0 +1,16 @@ +# 05-ddl +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# column types Hibernate generated (information_schema.columns) +event odt_column_col_offset integer precision null +event id bigint precision null +event instant_col timestamp with time zone precision 6 +event ldt_col timestamp without time zone precision 6 +event odt_column_col timestamp with time zone precision 6 +event odt_default_col timestamp with time zone precision 6 +event odt_native_col timestamp with time zone precision 6 +event odt_normalize_col timestamp without time zone precision 6 +event odt_normalize_utc_col timestamp with time zone precision 6 +zoned_event zdt_column_col_offset integer precision null +zoned_event id bigint precision null +zoned_event zdt_column_col timestamp with time zone precision 6 +zoned_event zdt_default_col timestamp with time zone precision 6 diff --git a/date-time/output/06-jdbc-time-zone-h2-America_New_York-directfalse-h8.txt b/date-time/output/06-jdbc-time-zone-h2-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..b8f5241 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-h2-America_New_York-directfalse-h8.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# hibernate.jdbc.time_zone=Asia/Kolkata while the JVM default zone is America/New_York +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 18:30:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T09:00+05:30 | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/06-jdbc-time-zone-h2-America_New_York-directtrue-h7.txt b/date-time/output/06-jdbc-time-zone-h2-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..98f8a81 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-h2-America_New_York-directtrue-h7.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# hibernate.jdbc.time_zone=Asia/Kolkata while the JVM default zone is America/New_York +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 09:00:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T09:00+05:30 | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/06-jdbc-time-zone-h2-America_New_York-h7.txt b/date-time/output/06-jdbc-time-zone-h2-America_New_York-h7.txt new file mode 100644 index 0000000..443db80 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-h2-America_New_York-h7.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# hibernate.jdbc.time_zone=Asia/Kolkata while the JVM default zone is America/New_York +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 18:30:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T09:00+05:30 | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/06-jdbc-time-zone-h2-America_New_York-h8.txt b/date-time/output/06-jdbc-time-zone-h2-America_New_York-h8.txt new file mode 100644 index 0000000..9ce2de0 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-h2-America_New_York-h8.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# hibernate.jdbc.time_zone=Asia/Kolkata while the JVM default zone is America/New_York +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 09:00:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T09:00+05:30 | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/06-jdbc-time-zone-h2-Asia_Kolkata-h7.txt b/date-time/output/06-jdbc-time-zone-h2-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..0b7faad --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-h2-Asia_Kolkata-h7.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# hibernate.jdbc.time_zone=America/New_York while the JVM default zone is Asia/Kolkata +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-03 23:30:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T09:00+05:30 | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/06-jdbc-time-zone-h2-Asia_Kolkata-h8.txt b/date-time/output/06-jdbc-time-zone-h2-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..48cda11 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-h2-Asia_Kolkata-h8.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# hibernate.jdbc.time_zone=America/New_York while the JVM default zone is Asia/Kolkata +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 09:00:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T09:00+05:30 | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/06-jdbc-time-zone-postgres-America_New_York-directfalse-h8.txt b/date-time/output/06-jdbc-time-zone-postgres-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..ee52b53 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-postgres-America_New_York-directfalse-h8.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# hibernate.jdbc.time_zone=Asia/Kolkata while the JVM default zone is America/New_York +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 18:30:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00-04 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T03:30Z | raw 2026-07-03 23:30:00-04 diff --git a/date-time/output/06-jdbc-time-zone-postgres-America_New_York-directtrue-h7.txt b/date-time/output/06-jdbc-time-zone-postgres-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..4d40d35 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-postgres-America_New_York-directtrue-h7.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# hibernate.jdbc.time_zone=Asia/Kolkata while the JVM default zone is America/New_York +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 09:00:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00-04 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T03:30Z | raw 2026-07-03 23:30:00-04 diff --git a/date-time/output/06-jdbc-time-zone-postgres-America_New_York-h7.txt b/date-time/output/06-jdbc-time-zone-postgres-America_New_York-h7.txt new file mode 100644 index 0000000..3e088cc --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-postgres-America_New_York-h7.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# hibernate.jdbc.time_zone=Asia/Kolkata while the JVM default zone is America/New_York +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 18:30:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00-04 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T03:30Z | raw 2026-07-03 23:30:00-04 diff --git a/date-time/output/06-jdbc-time-zone-postgres-America_New_York-h8.txt b/date-time/output/06-jdbc-time-zone-postgres-America_New_York-h8.txt new file mode 100644 index 0000000..e2daa49 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-postgres-America_New_York-h8.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# hibernate.jdbc.time_zone=Asia/Kolkata while the JVM default zone is America/New_York +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 09:00:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00-04 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T03:30Z | raw 2026-07-03 23:30:00-04 diff --git a/date-time/output/06-jdbc-time-zone-postgres-Asia_Kolkata-h7.txt b/date-time/output/06-jdbc-time-zone-postgres-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..94d70fc --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-postgres-Asia_Kolkata-h7.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# hibernate.jdbc.time_zone=America/New_York while the JVM default zone is Asia/Kolkata +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-03 23:30:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 09:00:00+05:30 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T03:30Z | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/06-jdbc-time-zone-postgres-Asia_Kolkata-h8.txt b/date-time/output/06-jdbc-time-zone-postgres-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..854b473 --- /dev/null +++ b/date-time/output/06-jdbc-time-zone-postgres-Asia_Kolkata-h8.txt @@ -0,0 +1,6 @@ +# 06-jdbc-time-zone +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# hibernate.jdbc.time_zone=America/New_York while the JVM default zone is Asia/Kolkata +LocalDateTime in 2026-07-04T09:00 | out 2026-07-04T09:00 | raw 2026-07-04 09:00:00 +Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 09:00:00+05:30 +OffsetDateTime in 2026-07-04T09:00+05:30 | out 2026-07-04T03:30Z | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-directfalse-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-directfalse-h8.txt new file mode 100644 index 0000000..1f58430 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-directfalse-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-directtrue-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-directtrue-h7.txt new file mode 100644 index 0000000..9f8c400 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-directtrue-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-h7.txt new file mode 100644 index 0000000..2b056c2 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-h8.txt new file mode 100644 index 0000000..0b7b533 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-directfalse-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-directfalse-h8.txt new file mode 100644 index 0000000..91d4c06 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-directfalse-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-directtrue-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-directtrue-h7.txt new file mode 100644 index 0000000..c0c0d71 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-directtrue-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-h7.txt new file mode 100644 index 0000000..b080e95 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-h8.txt new file mode 100644 index 0000000..fab742c --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-America_New_York-timestamp_utc-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp-h7.txt new file mode 100644 index 0000000..8b560fa --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 09:00:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp-h8.txt new file mode 100644 index 0000000..cc101d6 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 09:00:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp_utc-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp_utc-h7.txt new file mode 100644 index 0000000..d25230c --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp_utc-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp_utc-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp_utc-h8.txt new file mode 100644 index 0000000..e351f0f --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-h2-Asia_Kolkata-timestamp_utc-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 03:30:00+00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-directfalse-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-directfalse-h8.txt new file mode 100644 index 0000000..a8a4800 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-directfalse-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp without time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-directtrue-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-directtrue-h7.txt new file mode 100644 index 0000000..20ac4e6 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-directtrue-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp without time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-h7.txt new file mode 100644 index 0000000..7eef8f8 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp without time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-h8.txt new file mode 100644 index 0000000..f540ab5 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp without time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-directfalse-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-directfalse-h8.txt new file mode 100644 index 0000000..de2d7ee --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-directfalse-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00-04 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-directtrue-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-directtrue-h7.txt new file mode 100644 index 0000000..cebbea9 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-directtrue-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00-04 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-h7.txt new file mode 100644 index 0000000..bc54136 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00-04 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-h8.txt new file mode 100644 index 0000000..dbc4e18 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-America_New_York-timestamp_utc-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-03 23:30:00-04 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp-h7.txt new file mode 100644 index 0000000..c62d6c6 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp without time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 09:00:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp-h8.txt new file mode 100644 index 0000000..e7fb715 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP +column type timestamp without time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 09:00:00 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp_utc-h7.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp_utc-h7.txt new file mode 100644 index 0000000..3d0b1b9 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp_utc-h7.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp_utc-h8.txt b/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp_utc-h8.txt new file mode 100644 index 0000000..e93cf36 --- /dev/null +++ b/date-time/output/07-preferred-instant-jdbc-type-postgres-Asia_Kolkata-timestamp_utc-h8.txt @@ -0,0 +1,4 @@ +# 07-preferred-instant-jdbc-type (timestamp_utc) +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# hibernate.type.preferred_instant_jdbc_type=TIMESTAMP_UTC +column type timestamp with time zone | Instant in 2026-07-04T03:30:00Z | out 2026-07-04T03:30:00Z | raw 2026-07-04 09:00:00+05:30 diff --git a/date-time/output/08-column-precision-h2-America_New_York-directfalse-h8.txt b/date-time/output/08-column-precision-h2-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..7db80cc --- /dev/null +++ b/date-time/output/08-column-precision-h2-America_New_York-directfalse-h8.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 9 +ldt_default timestamp precision 6 +ldt_precision9 timestamp precision 6 +ldt_second_precision3 timestamp precision 3 +ldt_second_precision9 timestamp precision 9 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123456789 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123456789Z diff --git a/date-time/output/08-column-precision-h2-America_New_York-directtrue-h7.txt b/date-time/output/08-column-precision-h2-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..cbe6ea3 --- /dev/null +++ b/date-time/output/08-column-precision-h2-America_New_York-directtrue-h7.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 9 +ldt_default timestamp precision 6 +ldt_precision9 timestamp precision 6 +ldt_second_precision3 timestamp precision 3 +ldt_second_precision9 timestamp precision 9 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123456789 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123456789Z diff --git a/date-time/output/08-column-precision-h2-America_New_York-h7.txt b/date-time/output/08-column-precision-h2-America_New_York-h7.txt new file mode 100644 index 0000000..bc81f29 --- /dev/null +++ b/date-time/output/08-column-precision-h2-America_New_York-h7.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 9 +ldt_default timestamp precision 6 +ldt_precision9 timestamp precision 6 +ldt_second_precision3 timestamp precision 3 +ldt_second_precision9 timestamp precision 9 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123456789 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123456789Z diff --git a/date-time/output/08-column-precision-h2-America_New_York-h8.txt b/date-time/output/08-column-precision-h2-America_New_York-h8.txt new file mode 100644 index 0000000..04d5644 --- /dev/null +++ b/date-time/output/08-column-precision-h2-America_New_York-h8.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 9 +ldt_default timestamp precision 6 +ldt_precision9 timestamp precision 6 +ldt_second_precision3 timestamp precision 3 +ldt_second_precision9 timestamp precision 9 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123456789 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123456789Z diff --git a/date-time/output/08-column-precision-h2-Asia_Kolkata-h7.txt b/date-time/output/08-column-precision-h2-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..9793537 --- /dev/null +++ b/date-time/output/08-column-precision-h2-Asia_Kolkata-h7.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 9 +ldt_default timestamp precision 6 +ldt_precision9 timestamp precision 6 +ldt_second_precision3 timestamp precision 3 +ldt_second_precision9 timestamp precision 9 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123456789 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123456789Z diff --git a/date-time/output/08-column-precision-h2-Asia_Kolkata-h8.txt b/date-time/output/08-column-precision-h2-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..7de9f17 --- /dev/null +++ b/date-time/output/08-column-precision-h2-Asia_Kolkata-h8.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 9 +ldt_default timestamp precision 6 +ldt_precision9 timestamp precision 6 +ldt_second_precision3 timestamp precision 3 +ldt_second_precision9 timestamp precision 9 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123456789 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123456789Z diff --git a/date-time/output/08-column-precision-postgres-America_New_York-directfalse-h8.txt b/date-time/output/08-column-precision-postgres-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..7f3cc42 --- /dev/null +++ b/date-time/output/08-column-precision-postgres-America_New_York-directfalse-h8.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 6 +ldt_default timestamp without time zone precision 6 +ldt_precision9 timestamp without time zone precision 6 +ldt_second_precision3 timestamp without time zone precision 3 +ldt_second_precision9 timestamp without time zone precision 6 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123457Z diff --git a/date-time/output/08-column-precision-postgres-America_New_York-directtrue-h7.txt b/date-time/output/08-column-precision-postgres-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..15283c1 --- /dev/null +++ b/date-time/output/08-column-precision-postgres-America_New_York-directtrue-h7.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 6 +ldt_default timestamp without time zone precision 6 +ldt_precision9 timestamp without time zone precision 6 +ldt_second_precision3 timestamp without time zone precision 3 +ldt_second_precision9 timestamp without time zone precision 6 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123457Z diff --git a/date-time/output/08-column-precision-postgres-America_New_York-h7.txt b/date-time/output/08-column-precision-postgres-America_New_York-h7.txt new file mode 100644 index 0000000..5860643 --- /dev/null +++ b/date-time/output/08-column-precision-postgres-America_New_York-h7.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 6 +ldt_default timestamp without time zone precision 6 +ldt_precision9 timestamp without time zone precision 6 +ldt_second_precision3 timestamp without time zone precision 3 +ldt_second_precision9 timestamp without time zone precision 6 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123457Z diff --git a/date-time/output/08-column-precision-postgres-America_New_York-h8.txt b/date-time/output/08-column-precision-postgres-America_New_York-h8.txt new file mode 100644 index 0000000..cd9f792 --- /dev/null +++ b/date-time/output/08-column-precision-postgres-America_New_York-h8.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 6 +ldt_default timestamp without time zone precision 6 +ldt_precision9 timestamp without time zone precision 6 +ldt_second_precision3 timestamp without time zone precision 3 +ldt_second_precision9 timestamp without time zone precision 6 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123457Z diff --git a/date-time/output/08-column-precision-postgres-Asia_Kolkata-h7.txt b/date-time/output/08-column-precision-postgres-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..03deb0b --- /dev/null +++ b/date-time/output/08-column-precision-postgres-Asia_Kolkata-h7.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 6 +ldt_default timestamp without time zone precision 6 +ldt_precision9 timestamp without time zone precision 6 +ldt_second_precision3 timestamp without time zone precision 3 +ldt_second_precision9 timestamp without time zone precision 6 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123457Z diff --git a/date-time/output/08-column-precision-postgres-Asia_Kolkata-h8.txt b/date-time/output/08-column-precision-postgres-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..b2f4351 --- /dev/null +++ b/date-time/output/08-column-precision-postgres-Asia_Kolkata-h8.txt @@ -0,0 +1,13 @@ +# 08-column-precision +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# written: 2026-06-15T14:00:00.123456789 (nanos .123456789); generated column types, then what came back +instant_second_precision9 timestamp with time zone precision 6 +ldt_default timestamp without time zone precision 6 +ldt_precision9 timestamp without time zone precision 6 +ldt_second_precision3 timestamp without time zone precision 3 +ldt_second_precision9 timestamp without time zone precision 6 +default -> 2026-06-15T14:00:00.123457 +precision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 9 -> 2026-06-15T14:00:00.123457 +secondPrecision = 3 -> 2026-06-15T14:00:00.123 +Instant, secondPrecision = 9 -> 2026-06-15T14:00:00.123457Z diff --git a/date-time/output/09-legacy-types-h2-America_New_York-directfalse-h8.txt b/date-time/output/09-legacy-types-h2-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..12bd4de --- /dev/null +++ b/date-time/output/09-legacy-types-h2-America_New_York-directfalse-h8.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp precision 6 +year_month_col binary varying precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-h2-America_New_York-directtrue-h7.txt b/date-time/output/09-legacy-types-h2-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..ad1c47c --- /dev/null +++ b/date-time/output/09-legacy-types-h2-America_New_York-directtrue-h7.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp precision 6 +year_month_col binary varying precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-h2-America_New_York-h7.txt b/date-time/output/09-legacy-types-h2-America_New_York-h7.txt new file mode 100644 index 0000000..ad400e6 --- /dev/null +++ b/date-time/output/09-legacy-types-h2-America_New_York-h7.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp precision 6 +year_month_col binary varying precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-h2-America_New_York-h8.txt b/date-time/output/09-legacy-types-h2-America_New_York-h8.txt new file mode 100644 index 0000000..377a834 --- /dev/null +++ b/date-time/output/09-legacy-types-h2-America_New_York-h8.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp precision 6 +year_month_col binary varying precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-h2-Asia_Kolkata-h7.txt b/date-time/output/09-legacy-types-h2-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..e1d257e --- /dev/null +++ b/date-time/output/09-legacy-types-h2-Asia_Kolkata-h7.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 7.4.14.Final, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp precision 6 +year_month_col binary varying precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-h2-Asia_Kolkata-h8.txt b/date-time/output/09-legacy-types-h2-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..999369b --- /dev/null +++ b/date-time/output/09-legacy-types-h2-Asia_Kolkata-h8.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 8.0.0.Beta4, JDK 25, database H2 2.5.252 (2026-09-23), JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp precision 6 +year_month_col binary varying precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-postgres-America_New_York-directfalse-h8.txt b/date-time/output/09-legacy-types-postgres-America_New_York-directfalse-h8.txt new file mode 100644 index 0000000..659d302 --- /dev/null +++ b/date-time/output/09-legacy-types-postgres-America_New_York-directfalse-h8.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (set) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp without time zone precision 6 +year_month_col bytea precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-postgres-America_New_York-directtrue-h7.txt b/date-time/output/09-legacy-types-postgres-America_New_York-directtrue-h7.txt new file mode 100644 index 0000000..d2573a1 --- /dev/null +++ b/date-time/output/09-legacy-types-postgres-America_New_York-directtrue-h7.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (set) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp without time zone precision 6 +year_month_col bytea precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-postgres-America_New_York-h7.txt b/date-time/output/09-legacy-types-postgres-America_New_York-h7.txt new file mode 100644 index 0000000..9d9bde7 --- /dev/null +++ b/date-time/output/09-legacy-types-postgres-America_New_York-h7.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc false (default) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp without time zone precision 6 +year_month_col bytea precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-postgres-America_New_York-h8.txt b/date-time/output/09-legacy-types-postgres-America_New_York-h8.txt new file mode 100644 index 0000000..d32abe6 --- /dev/null +++ b/date-time/output/09-legacy-types-postgres-America_New_York-h8.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone America/New_York, java_time_use_direct_jdbc true (default) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp without time zone precision 6 +year_month_col bytea precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-postgres-Asia_Kolkata-h7.txt b/date-time/output/09-legacy-types-postgres-Asia_Kolkata-h7.txt new file mode 100644 index 0000000..c2bd837 --- /dev/null +++ b/date-time/output/09-legacy-types-postgres-Asia_Kolkata-h7.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 7.4.14.Final, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc false (default) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp without time zone precision 6 +year_month_col bytea precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/09-legacy-types-postgres-Asia_Kolkata-h8.txt b/date-time/output/09-legacy-types-postgres-Asia_Kolkata-h8.txt new file mode 100644 index 0000000..21e2538 --- /dev/null +++ b/date-time/output/09-legacy-types-postgres-Asia_Kolkata-h8.txt @@ -0,0 +1,12 @@ +# 09-legacy-types +# Hibernate ORM 8.0.0.Beta4, JDK 25, database PostgreSQL 17.11, JVM default zone Asia/Kolkata, java_time_use_direct_jdbc true (default) +# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip +duration_col numeric precision null +year_col integer precision null +util_date_col timestamp without time zone precision 6 +year_month_col bytea precision null +java.util.Date in 2026-06-15T08:30:00Z | out 2026-06-15T08:30:00Z | class java.sql.Timestamp +java.util.Date in.equals(out) true | out.equals(in) false +Year in 2026 | out 2026 +YearMonth in 2026-06 | out 2026-06 +Duration in PT1H30M | out PT1H30M diff --git a/date-time/output/10-javap-hibernate-settings.txt b/date-time/output/10-javap-hibernate-settings.txt new file mode 100644 index 0000000..5f68265 --- /dev/null +++ b/date-time/output/10-javap-hibernate-settings.txt @@ -0,0 +1,25 @@ +## hibernate-core 7.4.14.Final: org.hibernate.annotations.TimeZoneStorageType + public static final org.hibernate.annotations.TimeZoneStorageType NATIVE; + public static final org.hibernate.annotations.TimeZoneStorageType NORMALIZE; + public static final org.hibernate.annotations.TimeZoneStorageType NORMALIZE_UTC; + public static final org.hibernate.annotations.TimeZoneStorageType COLUMN; + public static final org.hibernate.annotations.TimeZoneStorageType AUTO; + public static final org.hibernate.annotations.TimeZoneStorageType DEFAULT; +## hibernate-core 7.4.14.Final: relevant setting names +public static final java.lang.String PREFERRED_INSTANT_JDBC_TYPE = "hibernate.type.preferred_instant_jdbc_type"; +public static final java.lang.String JAVA_TIME_USE_DIRECT_JDBC = "hibernate.type.java_time_use_direct_jdbc"; +public static final java.lang.String TIMEZONE_DEFAULT_STORAGE = "hibernate.timezone.default_storage"; +public static final java.lang.String JDBC_TIME_ZONE = "hibernate.jdbc.time_zone"; +## hibernate-core 8.0.0.Beta4: org.hibernate.annotations.TimeZoneStorageType + public static final org.hibernate.annotations.TimeZoneStorageType NATIVE; + public static final org.hibernate.annotations.TimeZoneStorageType NORMALIZE; + public static final org.hibernate.annotations.TimeZoneStorageType NORMALIZE_UTC; + public static final org.hibernate.annotations.TimeZoneStorageType COLUMN; + public static final org.hibernate.annotations.TimeZoneStorageType AUTO; + public static final org.hibernate.annotations.TimeZoneStorageType DEFAULT; +## hibernate-core 8.0.0.Beta4: relevant setting names +public static final java.lang.String PREFERRED_INSTANT_JDBC_TYPE = "hibernate.type.preferred_instant_jdbc_type"; +public static final java.lang.String JAVA_TIME_USE_DIRECT_JDBC = "hibernate.type.java_time_use_direct_jdbc"; +public static final boolean JAVA_TIME_USE_DIRECT_JDBC_DEFAULT = true; +public static final java.lang.String TIMEZONE_DEFAULT_STORAGE = "hibernate.timezone.default_storage"; +public static final java.lang.String JDBC_TIME_ZONE = "hibernate.jdbc.time_zone"; diff --git a/date-time/output/10-javap-jakarta-persistence.txt b/date-time/output/10-javap-jakarta-persistence.txt new file mode 100644 index 0000000..3e049c7 --- /dev/null +++ b/date-time/output/10-javap-jakarta-persistence.txt @@ -0,0 +1,16 @@ +## jakarta.persistence-api 3.2.0: jakarta.persistence.Temporal +public interface jakarta.persistence.Temporal extends java.lang.annotation.Annotation + #14 = Utf8 since +Deprecated: true + since="3.2" +## jakarta.persistence-api 3.2.0: jakarta.persistence.Column second-precision attribute + public abstract int precision(); + public abstract int secondPrecision(); +## jakarta.persistence-api 4.0.0-M7: jakarta.persistence.Temporal +public interface jakarta.persistence.Temporal extends java.lang.annotation.Annotation + #14 = Utf8 since +Deprecated: true + since="3.2" +## jakarta.persistence-api 4.0.0-M7: jakarta.persistence.Column second-precision attribute + public abstract int precision(); + public abstract int secondPrecision(); diff --git a/date-time/pom.xml b/date-time/pom.xml new file mode 100644 index 0000000..83f227a --- /dev/null +++ b/date-time/pom.xml @@ -0,0 +1,95 @@ + + + 4.0.0 + + com.ankurm + date-time + 1.0.0 + date-time + Hibernate 7 date/time mapping: Instant vs LocalDateTime vs OffsetDateTime vs ZonedDateTime, round-tripped across JVM time zones on H2 and PostgreSQL (plain Hibernate, no Spring) + + + 25 + UTF-8 + + 7.4.14.Final + 3.2.0 + h7 + -Duser.timezone=UTC + h2 + both + none + default + + + + + org.hibernate.orm + hibernate-core + ${hibernate.version} + + + jakarta.persistence + jakarta.persistence-api + ${persistence.version} + + + com.h2database + h2 + 2.5.252 + + + org.postgresql + postgresql + 42.7.14 + + + org.hsqldb + hsqldb + 2.7.4 + test + + + org.slf4j + slf4j-nop + 2.0.17 + runtime + + + org.junit.jupiter + junit-jupiter + 6.0.3 + test + + + org.assertj + assertj-core + 3.27.7 + test + + + + + + + maven-surefire-plugin + 3.6.0 + + + -Xmx512m ${dt.jvmargs} + + ${h.label} + ${hibernate.version} + ${dt.db} + ${dt.phase} + ${dt.pg.url} + ${dt.directJdbc} + + + + + + diff --git a/date-time/scripts/javap-facts.sh b/date-time/scripts/javap-facts.sh new file mode 100755 index 0000000..d7754da --- /dev/null +++ b/date-time/scripts/javap-facts.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Writes output/10-javap-*.txt: what the jars themselves say (constants, deprecations, setting names). +# Needs the jars in ~/.m2, so run it after a Maven build of each Hibernate line (run-all.sh does). +set -euo pipefail +cd "$(dirname "$0")/.." +M="$HOME/.m2/repository" +H7="$M/org/hibernate/orm/hibernate-core/7.4.14.Final/hibernate-core-7.4.14.Final.jar" +H8="$M/org/hibernate/orm/hibernate-core/8.0.0.Beta4/hibernate-core-8.0.0.Beta4.jar" +P32="$M/jakarta/persistence/jakarta.persistence-api/3.2.0/jakarta.persistence-api-3.2.0.jar" +P40="$M/jakarta/persistence/jakarta.persistence-api/4.0.0-M7/jakarta.persistence-api-4.0.0-M7.jar" +jp() { javap "$@" 2>&1 | grep -v '^Picked up'; } +mkdir -p output +{ + for pair in "7.4.14.Final:$H7" "8.0.0.Beta4:$H8"; do + v="${pair%%:*}"; j="${pair#*:}" + echo "## hibernate-core $v: org.hibernate.annotations.TimeZoneStorageType" + jp -cp "$j" org.hibernate.annotations.TimeZoneStorageType | grep 'public static final' + echo "## hibernate-core $v: relevant setting names" + jp -constants -cp "$j" org.hibernate.cfg.MappingSettings | grep -E 'JAVA_TIME|PREFERRED_INSTANT|TIMEZONE_DEFAULT' | sed 's/^ *//' + jp -constants -cp "$j" org.hibernate.cfg.JdbcSettings | grep -E 'JDBC_TIME_ZONE' | sed 's/^ *//' + done +} > output/10-javap-hibernate-settings.txt +{ + for pair in "3.2.0:$P32" "4.0.0-M7:$P40"; do + v="${pair%%:*}"; j="${pair#*:}" + echo "## jakarta.persistence-api $v: jakarta.persistence.Temporal" + jp -v -cp "$j" jakarta.persistence.Temporal | grep -E 'Deprecated: true|since|public interface' + echo "## jakarta.persistence-api $v: jakarta.persistence.Column second-precision attribute" + jp -cp "$j" jakarta.persistence.Column | grep -iE 'precision' + done +} > output/10-javap-jakarta-persistence.txt +ls -1 output/10-* diff --git a/date-time/scripts/run-all.sh b/date-time/scripts/run-all.sh new file mode 100755 index 0000000..59e01fa --- /dev/null +++ b/date-time/scripts/run-all.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +# Regenerates every file under output/. Needs JDK 25, Maven 3.9 (online, first run), and Docker +# (PostgreSQL 17 runs in a throwaway container on a random localhost port). +# +# Matrix: database (H2 file db, PostgreSQL 17) x JVM default zone (Asia/Kolkata, America/New_York) +# same-JVM round trips, plus cross-zone round trips (write in one zone, read in the other), +# then java_time_use_direct_jdbc=true on Hibernate 7, then the same on Hibernate 8.0.0.Beta4. +# Pass H7_ONLY=1 to skip the Hibernate 8 beta runs, H8_ONLY=1 to run only those (keeps existing output/). +set -euo pipefail +cd "$(dirname "$0")/.." + +K=Asia/Kolkata +NY=America/New_York +NAME="dt-pg-$$" +cleanup() { docker rm -f "$NAME" >/dev/null 2>&1 || true; } +trap cleanup EXIT + +docker run -d --rm --name "$NAME" -e POSTGRES_PASSWORD=postgres -p 127.0.0.1::5432 postgres:17-alpine >/dev/null +PORT="$(docker port "$NAME" 5432/tcp | head -1 | sed 's/.*://')" +for _ in $(seq 1 60); do + docker exec "$NAME" pg_isready -U postgres >/dev/null 2>&1 && break + sleep 1 +done +sleep 2 +PGURL="jdbc:postgresql://127.0.0.1:${PORT}/postgres" +echo "postgres: $(docker exec "$NAME" psql -U postgres -Atc 'select version()')" >&2 + +mkdir -p output +[ -n "${H8_ONLY:-}" ] || { rm -rf output; mkdir -p output; } + +if [ -z "${H8_ONLY:-}" ]; then + { + echo "# environment for this run of scripts/run-all.sh" + java -version 2>&1 | grep -v '^Picked up' + echo "postgres server: $(docker exec "$NAME" psql -U postgres -Atc 'select version()')" + echo "postgres image: $(docker image inspect --format '{{index .RepoDigests 0}}' postgres:17-alpine)" + echo "postgres server TimeZone setting: $(docker exec "$NAME" psql -U postgres -Atc 'show timezone')" + echo "jdbc drivers: org.postgresql:postgresql:42.7.14, com.h2database:h2:2.5.252, org.hsqldb:hsqldb:2.7.4" + } > output/00-environment.txt +fi + +run() { # db, phase, jvm zone, extra maven -D flags... + local db="$1" phase="$2" zone="$3"; shift 3 + echo "== db=$db phase=$phase zone=$zone $*" >&2 + mvn -B -q surefire:test -Ddt.db="$db" -Ddt.phase="$phase" -Ddt.pg.url="$PGURL" \ + -Ddt.jvmargs="-Duser.timezone=$zone -Ddt.writerZone=${WRITER:-none}" "$@" +} + +if [ -z "${H8_ONLY:-}" ]; then +mvn -B -q clean test-compile +for db in h2 postgres; do + run "$db" both "$K" + run "$db" both "$NY" + # cross-zone: the writer JVM and the reader JVM have different default zones + WRITER="$K" run "$db" write "$K" -Dtest=RoundTripTest,ZonedTest + WRITER="$K" run "$db" read "$NY" -Dtest=RoundTripTest,ZonedTest + WRITER="$NY" run "$db" write "$NY" -Dtest=RoundTripTest,ZonedTest + WRITER="$NY" run "$db" read "$K" -Dtest=RoundTripTest,ZonedTest + # Hibernate 7's default is java_time_use_direct_jdbc=false; flip it + run "$db" both "$NY" -Ddt.directJdbc=true +done +# HSQLDB is only here to re-check the old "H2 rounds, HSQLDB truncates" claim +run hsqldb both "$K" -Dtest=EdgeCasesTest#precision +fi + +if [ -z "${H7_ONLY:-}" ]; then + H8="-Dhibernate.version=8.0.0.Beta4 -Dpersistence.version=4.0.0-M7 -Dh.label=h8" + # shellcheck disable=SC2086 + mvn -B -q clean test-compile $H8 + for db in h2 postgres; do + # shellcheck disable=SC2086 + { run "$db" both "$K" $H8 + run "$db" both "$NY" $H8 + run "$db" both "$NY" $H8 -Ddt.directJdbc=false; } + done +fi + +[ -n "${H7_ONLY:-}" ] || ./scripts/javap-facts.sh >/dev/null + +ls -1 output | wc -l diff --git a/date-time/src/main/java/com/ankurm/datetime/Db.java b/date-time/src/main/java/com/ankurm/datetime/Db.java new file mode 100644 index 0000000..07ddcc3 --- /dev/null +++ b/date-time/src/main/java/com/ankurm/datetime/Db.java @@ -0,0 +1,75 @@ +package com.ankurm.datetime; + +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; + +import java.nio.file.Path; +import java.util.Map; + +/** + * Builds a plain Hibernate SessionFactory against H2 or PostgreSQL. Everything the tests vary comes + * in through system properties so one compiled test class can run in any JVM time zone: + * dt.db = h2 | postgres | hsqldb, dt.pg.url, dt.phase = both | write | read, dt.directJdbc = default | true | false. + */ +public final class Db { + + private Db() { + } + + public static String kind() { + return System.getProperty("dt.db", "h2"); + } + + public static String phase() { + return System.getProperty("dt.phase", "both"); + } + + /** + * The effective value of hibernate.type.java_time_use_direct_jdbc: the explicit dt.directJdbc if + * given, otherwise the default of the Hibernate line under test (false on 7.x, true on 8.0 beta). + */ + public static boolean directJdbc() { + String v = System.getProperty("dt.directJdbc", "default"); + return v.equals("default") ? System.getProperty("h.label", "h7").equals("h8") : Boolean.parseBoolean(v); + } + + public static boolean available() { + return !kind().equals("postgres") || !System.getProperty("dt.pg.url", "none").equals("none"); + } + + public static String jdbcUrl() { + if (kind().equals("postgres")) { + return System.getProperty("dt.pg.url"); + } + if (kind().equals("hsqldb")) { + return "jdbc:hsqldb:mem:dt"; // same-JVM only; used for the precision comparison + } + // File database so a second JVM (with a different time zone) can read what the first wrote. + Path file = Path.of("target", "h2-data", "dt").toAbsolutePath(); + return "jdbc:h2:file:" + file; + } + + /** @param create true drops and recreates the tables, false only validates that they exist. */ + public static SessionFactory open(boolean create, Map extra, Class... entities) { + Configuration cfg = new Configuration(); + for (Class e : entities) { + cfg.addAnnotatedClass(e); + } + cfg.setProperty("hibernate.connection.url", jdbcUrl()); + if (kind().equals("postgres")) { + cfg.setProperty("hibernate.connection.username", "postgres"); + cfg.setProperty("hibernate.connection.password", "postgres"); + } + else { + cfg.setProperty("hibernate.connection.username", "sa"); + cfg.setProperty("hibernate.connection.password", ""); + } + cfg.setProperty("hibernate.hbm2ddl.auto", create ? "create" : "validate"); + String direct = System.getProperty("dt.directJdbc", "default"); + if (!direct.equals("default")) { + cfg.setProperty("hibernate.type.java_time_use_direct_jdbc", direct); + } + extra.forEach(cfg::setProperty); + return cfg.buildSessionFactory(); + } +} diff --git a/date-time/src/main/java/com/ankurm/datetime/Event.java b/date-time/src/main/java/com/ankurm/datetime/Event.java new file mode 100644 index 0000000..e38aa6f --- /dev/null +++ b/date-time/src/main/java/com/ankurm/datetime/Event.java @@ -0,0 +1,78 @@ +package com.ankurm.datetime; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import org.hibernate.annotations.TimeZoneColumn; +import org.hibernate.annotations.TimeZoneStorage; +import org.hibernate.annotations.TimeZoneStorageType; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; + +/** + * One row, one column per way of storing "a moment" with java.time. The test writes the same + * moment into every column and reads it back in a new session (and, in the cross-zone runs, in a + * different JVM with a different default time zone). + */ +@Entity +@Table(name = "event") +public class Event { + + @Id + private Long id; + + /** A point on the UTC time line. */ + @Column(name = "instant_col") + private Instant instant; + + /** A calendar date and wall-clock time with no zone and no offset. */ + @Column(name = "ldt_col") + private LocalDateTime localDateTime; + + /** Hibernate's default storage for OffsetDateTime (dialect-derived, see 05-ddl). */ + @Column(name = "odt_default_col") + private OffsetDateTime offsetDefault; + + @TimeZoneStorage(TimeZoneStorageType.NATIVE) + @Column(name = "odt_native_col") + private OffsetDateTime offsetNative; + + @TimeZoneStorage(TimeZoneStorageType.NORMALIZE) + @Column(name = "odt_normalize_col") + private OffsetDateTime offsetNormalize; + + @TimeZoneStorage(TimeZoneStorageType.NORMALIZE_UTC) + @Column(name = "odt_normalize_utc_col") + private OffsetDateTime offsetNormalizeUtc; + + @TimeZoneStorage(TimeZoneStorageType.COLUMN) + @TimeZoneColumn(name = "odt_column_col_offset") + @Column(name = "odt_column_col") + private OffsetDateTime offsetColumn; + + protected Event() { + } + + public Event(Long id) { + this.id = id; + } + + public Long getId() { return id; } + public Instant getInstant() { return instant; } + public void setInstant(Instant v) { this.instant = v; } + public LocalDateTime getLocalDateTime() { return localDateTime; } + public void setLocalDateTime(LocalDateTime v) { this.localDateTime = v; } + public OffsetDateTime getOffsetDefault() { return offsetDefault; } + public void setOffsetDefault(OffsetDateTime v) { this.offsetDefault = v; } + public OffsetDateTime getOffsetNative() { return offsetNative; } + public void setOffsetNative(OffsetDateTime v) { this.offsetNative = v; } + public OffsetDateTime getOffsetNormalize() { return offsetNormalize; } + public void setOffsetNormalize(OffsetDateTime v) { this.offsetNormalize = v; } + public OffsetDateTime getOffsetNormalizeUtc() { return offsetNormalizeUtc; } + public void setOffsetNormalizeUtc(OffsetDateTime v) { this.offsetNormalizeUtc = v; } + public OffsetDateTime getOffsetColumn() { return offsetColumn; } + public void setOffsetColumn(OffsetDateTime v) { this.offsetColumn = v; } +} diff --git a/date-time/src/main/java/com/ankurm/datetime/Legacy.java b/date-time/src/main/java/com/ankurm/datetime/Legacy.java new file mode 100644 index 0000000..fd58060 --- /dev/null +++ b/date-time/src/main/java/com/ankurm/datetime/Legacy.java @@ -0,0 +1,49 @@ +package com.ankurm.datetime; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + +import java.time.Duration; +import java.time.Year; +import java.time.YearMonth; +import java.util.Date; + +/** Types people ask about: a java.util.Date with no @Temporal, and the java.time types with no SQL twin. */ +@Entity +@Table(name = "legacy") +public class Legacy { + + @Id + private Long id; + + /** No @Temporal annotation at all. */ + @Column(name = "util_date_col") + private Date utilDate; + + @Column(name = "year_col") + private Year year; + + @Column(name = "year_month_col") + private YearMonth yearMonth; + + @Column(name = "duration_col") + private Duration duration; + + protected Legacy() { + } + + public Legacy(Long id, Date utilDate, Year year, YearMonth yearMonth, Duration duration) { + this.id = id; + this.utilDate = utilDate; + this.year = year; + this.yearMonth = yearMonth; + this.duration = duration; + } + + public Date getUtilDate() { return utilDate; } + public Year getYear() { return year; } + public YearMonth getYearMonth() { return yearMonth; } + public Duration getDuration() { return duration; } +} diff --git a/date-time/src/main/java/com/ankurm/datetime/PrecisionEvent.java b/date-time/src/main/java/com/ankurm/datetime/PrecisionEvent.java new file mode 100644 index 0000000..e82c8d0 --- /dev/null +++ b/date-time/src/main/java/com/ankurm/datetime/PrecisionEvent.java @@ -0,0 +1,54 @@ +package com.ankurm.datetime; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + +import java.time.Instant; +import java.time.LocalDateTime; + +/** The same LocalDateTime/Instant under different @Column precision attributes. */ +@Entity +@Table(name = "precision_event") +public class PrecisionEvent { + + @Id + private Long id; + + /** No precision attribute at all: the dialect's default. */ + @Column(name = "ldt_default") + private LocalDateTime defaultPrecision; + + /** The attribute the old advice reaches for. */ + @Column(name = "ldt_precision9", precision = 9) + private LocalDateTime precision9; + + /** The attribute Jakarta Persistence 3.2 added for exactly this. */ + @Column(name = "ldt_second_precision9", secondPrecision = 9) + private LocalDateTime secondPrecision9; + + @Column(name = "ldt_second_precision3", secondPrecision = 3) + private LocalDateTime secondPrecision3; + + @Column(name = "instant_second_precision9", secondPrecision = 9) + private Instant instantSecondPrecision9; + + protected PrecisionEvent() { + } + + public PrecisionEvent(Long id, LocalDateTime value) { + this.id = id; + this.defaultPrecision = value; + this.precision9 = value; + this.secondPrecision9 = value; + this.secondPrecision3 = value; + this.instantSecondPrecision9 = value.toInstant(java.time.ZoneOffset.UTC); + } + + public LocalDateTime getDefaultPrecision() { return defaultPrecision; } + public LocalDateTime getPrecision9() { return precision9; } + public LocalDateTime getSecondPrecision9() { return secondPrecision9; } + public LocalDateTime getSecondPrecision3() { return secondPrecision3; } + public Instant getInstantSecondPrecision9() { return instantSecondPrecision9; } +} diff --git a/date-time/src/main/java/com/ankurm/datetime/Probe.java b/date-time/src/main/java/com/ankurm/datetime/Probe.java new file mode 100644 index 0000000..ce8c08c --- /dev/null +++ b/date-time/src/main/java/com/ankurm/datetime/Probe.java @@ -0,0 +1,48 @@ +package com.ankurm.datetime; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; + +/** A narrow entity for the edge cases: DST gaps and overlaps, and sub-microsecond precision. */ +@Entity +@Table(name = "probe") +public class Probe { + + @Id + private Long id; + + @Column(name = "label") + private String label; + + @Column(name = "ldt_col") + private LocalDateTime localDateTime; + + @Column(name = "instant_col") + private Instant instant; + + @Column(name = "odt_col") + private OffsetDateTime offsetDateTime; + + protected Probe() { + } + + public Probe(Long id, String label) { + this.id = id; + this.label = label; + } + + public Long getId() { return id; } + public String getLabel() { return label; } + public LocalDateTime getLocalDateTime() { return localDateTime; } + public void setLocalDateTime(LocalDateTime v) { this.localDateTime = v; } + public Instant getInstant() { return instant; } + public void setInstant(Instant v) { this.instant = v; } + public OffsetDateTime getOffsetDateTime() { return offsetDateTime; } + public void setOffsetDateTime(OffsetDateTime v) { this.offsetDateTime = v; } +} diff --git a/date-time/src/main/java/com/ankurm/datetime/ZonedEvent.java b/date-time/src/main/java/com/ankurm/datetime/ZonedEvent.java new file mode 100644 index 0000000..ed94abe --- /dev/null +++ b/date-time/src/main/java/com/ankurm/datetime/ZonedEvent.java @@ -0,0 +1,42 @@ +package com.ankurm.datetime; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import org.hibernate.annotations.TimeZoneColumn; +import org.hibernate.annotations.TimeZoneStorage; +import org.hibernate.annotations.TimeZoneStorageType; + +import java.time.ZonedDateTime; + +/** ZonedDateTime on its own entity, because on some driver settings it cannot be bound or read at all. */ +@Entity +@Table(name = "zoned_event") +public class ZonedEvent { + + @Id + private Long id; + + /** Hibernate's default storage for ZonedDateTime. */ + @Column(name = "zdt_default_col") + private ZonedDateTime zonedDefault; + + @TimeZoneStorage(TimeZoneStorageType.COLUMN) + @TimeZoneColumn(name = "zdt_column_col_offset") + @Column(name = "zdt_column_col") + private ZonedDateTime zonedColumn; + + protected ZonedEvent() { + } + + public ZonedEvent(Long id) { + this.id = id; + } + + public Long getId() { return id; } + public ZonedDateTime getZonedDefault() { return zonedDefault; } + public void setZonedDefault(ZonedDateTime v) { this.zonedDefault = v; } + public ZonedDateTime getZonedColumn() { return zonedColumn; } + public void setZonedColumn(ZonedDateTime v) { this.zonedColumn = v; } +} diff --git a/date-time/src/test/java/com/ankurm/datetime/EdgeCasesTest.java b/date-time/src/test/java/com/ankurm/datetime/EdgeCasesTest.java new file mode 100644 index 0000000..7bef7e8 --- /dev/null +++ b/date-time/src/test/java/com/ankurm/datetime/EdgeCasesTest.java @@ -0,0 +1,139 @@ +package com.ankurm.datetime; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.jupiter.api.*; + +import java.sql.ResultSet; +import java.sql.Statement; +import java.time.*; +import java.util.List; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Edge cases, always same-JVM: a LocalDateTime that does not exist in New York (the spring-forward + * gap), one that happens twice (the fall-back overlap), and nanosecond precision. + */ +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +class EdgeCasesTest { + + static final LocalDateTime GAP = LocalDateTime.of(2026, 3, 8, 2, 30); + static final LocalDateTime OVERLAP = LocalDateTime.of(2026, 11, 1, 1, 30); + static final LocalDateTime PLAIN = LocalDateTime.of(2026, 6, 15, 14, 0); + + @BeforeAll + static void needDatabase() { + Assumptions.assumeTrue(Db.available(), "dt.db=postgres but dt.pg.url is not set"); + Assumptions.assumeTrue(!Db.phase().equals("read") && !Db.phase().equals("write"), + "edge cases run only in same-JVM mode"); + } + + @Test + @Order(1) + void localDateTimeAroundDst() { + try (SessionFactory sf = Db.open(true, Map.of(), Probe.class)) { + List in = List.of(probe(1, "plain wall clock", PLAIN), probe(2, "gap 02:30 on 2026-03-08", GAP), + probe(3, "overlap 01:30 on 2026-11-01", OVERLAP)); + sf.inTransaction(s -> in.forEach(s::persist)); + try (Session s = sf.openSession()) { + String product = s.doReturningWork(Transcript::product); + Transcript t = new Transcript("02-dst", "local-date-time", product); + t.line("# New York springs forward 2026-03-08 02:00 -> 03:00 and falls back 2026-11-01 02:00 -> 01:00"); + for (Probe p : in) { + Probe out = s.find(Probe.class, p.getId()); + String raw = raw(s, "ldt_col", p.getId()); + t.line(String.format("%-28s in %-17s | out %-17s | equals %-5s | raw %s", p.getLabel(), + p.getLocalDateTime(), out.getLocalDateTime(), + p.getLocalDateTime().equals(out.getLocalDateTime()), raw)); + } + t.write(); + // A plain wall-clock time must always survive. + assertThat(s.find(Probe.class, 1L).getLocalDateTime()).isEqualTo(PLAIN); + assertThat(s.find(Probe.class, 3L).getLocalDateTime()).isEqualTo(OVERLAP); + // A time inside New York's spring-forward gap exists nowhere on the NY clock. With the + // legacy java.sql conversion (7.x default) the JVM moves it to 03:30; direct JDBC keeps it. + boolean newYork = ZoneId.systemDefault().getId().equals("America/New_York"); + LocalDateTime expectedGap = newYork && !Db.directJdbc() ? GAP.plusHours(1) : GAP; + assertThat(s.find(Probe.class, 2L).getLocalDateTime()).isEqualTo(expectedGap); + } + } + } + + @Test + @Order(2) + void precision() { + try (SessionFactory sf = Db.open(true, Map.of(), Probe.class)) { + int[] nanos = { 123_456_789, 123_456_500, 999_999_999, 123_456_499 }; + sf.inTransaction(s -> { + long id = 10; + for (int n : nanos) { + Probe p = probe(id++, "nanos " + n, null); + p.setLocalDateTime(LocalDateTime.of(2026, 6, 15, 14, 0, 0, n)); + p.setInstant(Instant.parse("2026-06-15T08:30:00Z").plusNanos(n)); + p.setOffsetDateTime(OffsetDateTime.of(2026, 6, 15, 14, 0, 0, n, ZoneOffset.ofHoursMinutes(5, 30))); + s.persist(p); + } + }); + try (Session s = sf.openSession()) { + String product = s.doReturningWork(Transcript::product); + Transcript t = new Transcript("03-precision", "", product); + t.line("# written: 14:00:00. local / 08:30:00.Z / 14:00:00.+05:30 ; read back below (columns are timestamp(6))"); + long id = 10; + for (int n : nanos) { + Probe out = s.find(Probe.class, id++); + t.line(String.format("nanos .%09d -> LocalDateTime %s | Instant %s | OffsetDateTime %s", + n, out.getLocalDateTime(), out.getInstant(), out.getOffsetDateTime())); + } + t.write(); + // Whatever the engine does with the last three digits, microseconds are never invented. + Probe first = s.find(Probe.class, 10L); + assertThat(first.getInstant().getNano() % 1000).isZero(); + } + } + } + + @Test + @Order(3) + void generatedColumnTypes() { + try (SessionFactory sf = Db.open(true, Map.of(), Event.class, ZonedEvent.class); + Session s = sf.openSession()) { + String product = s.doReturningWork(Transcript::product); + Transcript t = new Transcript("05-ddl", "", product); + t.line("# column types Hibernate generated (information_schema.columns)"); + List rows = s.doReturningWork(c -> { + try (Statement st = c.createStatement(); + ResultSet rs = st.executeQuery("select table_name, column_name, data_type, datetime_precision " + + "from information_schema.columns where lower(table_name) in ('event', 'zoned_event') " + + "and lower(table_schema) = 'public' order by table_name, ordinal_position")) { + List out = new java.util.ArrayList<>(); + while (rs.next()) { + out.add(String.format("%-12s %-24s %-28s precision %s", rs.getString(1).toLowerCase(), rs.getString(2).toLowerCase(), + rs.getString(3).toLowerCase(), rs.getString(4))); + } + return out; + } + }); + rows.forEach(t::line); + t.write(); + assertThat(rows).hasSize(13); + } + } + + private static Probe probe(long id, String label, LocalDateTime ldt) { + Probe p = new Probe(id, label); + p.setLocalDateTime(ldt); + return p; + } + + private static String raw(Session s, String column, long id) { + return s.doReturningWork(c -> { + try (Statement st = c.createStatement(); + ResultSet rs = st.executeQuery("select cast(" + column + " as varchar) from probe where id = " + id)) { + rs.next(); + return rs.getString(1); + } + }); + } +} diff --git a/date-time/src/test/java/com/ankurm/datetime/JdbcTimeZoneTest.java b/date-time/src/test/java/com/ankurm/datetime/JdbcTimeZoneTest.java new file mode 100644 index 0000000..1e8f001 --- /dev/null +++ b/date-time/src/test/java/com/ankurm/datetime/JdbcTimeZoneTest.java @@ -0,0 +1,96 @@ +package com.ankurm.datetime; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.jupiter.api.*; + +import java.sql.ResultSet; +import java.sql.Statement; +import java.time.*; +import java.util.Map; +import java.util.TimeZone; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * hibernate.jdbc.time_zone and hibernate.type.preferred_instant_jdbc_type, the two settings the old + * advice reaches for. Same-JVM only. + */ +class JdbcTimeZoneTest { + + static final LocalDateTime WALL = LocalDateTime.of(2026, 7, 4, 9, 0); + static final Instant MOMENT = Instant.parse("2026-07-04T03:30:00Z"); + + @BeforeAll + static void needDatabase() { + Assumptions.assumeTrue(Db.available(), "dt.db=postgres but dt.pg.url is not set"); + Assumptions.assumeTrue(!Db.phase().equals("read") && !Db.phase().equals("write")); + } + + /** Always the zone the JVM is not in, so the setting visibly disagrees with the JVM. */ + static String otherZone() { + return TimeZone.getDefault().getID().equals("America/New_York") ? "Asia/Kolkata" : "America/New_York"; + } + + @Test + void jdbcTimeZoneShiftsWhatIsBound() { + String zone = otherZone(); + try (SessionFactory sf = Db.open(true, Map.of("hibernate.jdbc.time_zone", zone), Probe.class)) { + Probe p = new Probe(1L, "jdbc.time_zone=" + zone); + p.setLocalDateTime(WALL); + p.setInstant(MOMENT); + p.setOffsetDateTime(OffsetDateTime.of(WALL, ZoneOffset.ofHoursMinutes(5, 30))); + sf.inTransaction(s -> s.persist(p)); + try (Session s = sf.openSession()) { + Probe out = s.find(Probe.class, 1L); + String[] raw = s.doReturningWork(c -> { + try (Statement st = c.createStatement(); + ResultSet rs = st.executeQuery("select cast(ldt_col as varchar), cast(instant_col as varchar), " + + "cast(odt_col as varchar) from probe where id = 1")) { + rs.next(); + return new String[] { rs.getString(1), rs.getString(2), rs.getString(3) }; + } + }); + Transcript t = new Transcript("06-jdbc-time-zone", "", s.doReturningWork(Transcript::product)); + t.line("# hibernate.jdbc.time_zone=" + zone + " while the JVM default zone is " + TimeZone.getDefault().getID()); + t.line("LocalDateTime in " + WALL + " | out " + out.getLocalDateTime() + " | raw " + raw[0]); + t.line("Instant in " + MOMENT + " | out " + out.getInstant() + " | raw " + raw[1]); + t.line("OffsetDateTime in " + p.getOffsetDateTime() + " | out " + out.getOffsetDateTime() + " | raw " + raw[2]); + t.write(); + // Through Hibernate the round trip is transparent whatever the setting says. + assertThat(out.getLocalDateTime()).isEqualTo(WALL); + assertThat(out.getInstant()).isEqualTo(MOMENT); + assertThat(out.getOffsetDateTime().toInstant()).isEqualTo(p.getOffsetDateTime().toInstant()); + } + } + } + + @Test + void preferredInstantJdbcType() { + for (String type : new String[] { "TIMESTAMP", "TIMESTAMP_UTC" }) { + try (SessionFactory sf = Db.open(true, Map.of("hibernate.type.preferred_instant_jdbc_type", type), Probe.class)) { + Probe p = new Probe(1L, "preferred_instant_jdbc_type=" + type); + p.setInstant(MOMENT); + sf.inTransaction(s -> s.persist(p)); + try (Session s = sf.openSession()) { + Probe out = s.find(Probe.class, 1L); + String[] r = s.doReturningWork(c -> { + try (Statement st = c.createStatement(); + ResultSet rs = st.executeQuery("select cast(instant_col as varchar), (select data_type from " + + "information_schema.columns where lower(table_name) = 'probe' and " + + "lower(column_name) = 'instant_col' and lower(table_schema) = 'public') from probe where id = 1")) { + rs.next(); + return new String[] { rs.getString(1), rs.getString(2).toLowerCase() }; + } + }); + Transcript t = new Transcript("07-preferred-instant-jdbc-type", type.toLowerCase(), + s.doReturningWork(Transcript::product)); + t.line("# hibernate.type.preferred_instant_jdbc_type=" + type); + t.line("column type " + r[1] + " | Instant in " + MOMENT + " | out " + out.getInstant() + " | raw " + r[0]); + t.write(); + assertThat(out.getInstant()).isEqualTo(MOMENT); + } + } + } + } +} diff --git a/date-time/src/test/java/com/ankurm/datetime/RoundTripTest.java b/date-time/src/test/java/com/ankurm/datetime/RoundTripTest.java new file mode 100644 index 0000000..ced4ee9 --- /dev/null +++ b/date-time/src/test/java/com/ankurm/datetime/RoundTripTest.java @@ -0,0 +1,130 @@ +package com.ankurm.datetime; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.jupiter.api.*; + +import java.sql.ResultSet; +import java.sql.Statement; +import java.time.*; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Writes one moment (2026-06-15T08:30:00Z) into every temporal column of {@link Event}, then reads + * it back in a brand-new session. With dt.phase=both both steps run in this JVM; with + * dt.phase=write / dt.phase=read they run in two JVMs with different -Duser.timezone values. + */ +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +class RoundTripTest { + + static final Instant MOMENT = Instant.parse("2026-06-15T08:30:00Z"); + static final LocalDateTime WALL = LocalDateTime.of(2026, 6, 15, 14, 0); + static final OffsetDateTime KOLKATA = OffsetDateTime.of(WALL, ZoneOffset.ofHoursMinutes(5, 30)); + + @BeforeAll + static void needDatabase() { + Assumptions.assumeTrue(Db.available(), "dt.db=postgres but dt.pg.url is not set"); + } + + @Test + @Order(1) + void write() { + Assumptions.assumeTrue(!Db.phase().equals("read")); + try (SessionFactory sf = Db.open(true, Map.of(), Event.class)) { + Event e = new Event(1L); + e.setInstant(MOMENT); + e.setLocalDateTime(WALL); + e.setOffsetDefault(KOLKATA); + e.setOffsetNative(KOLKATA); + e.setOffsetNormalize(KOLKATA); + e.setOffsetNormalizeUtc(KOLKATA); + e.setOffsetColumn(KOLKATA); + sf.inTransaction(s -> s.persist(e)); + } + } + + @Test + @Order(2) + void read() { + Assumptions.assumeTrue(!Db.phase().equals("write")); + try (SessionFactory sf = Db.open(false, Map.of(), Event.class); + Session s = sf.openSession()) { + String product = s.doReturningWork(Transcript::product); + Event e = s.find(Event.class, 1L); + String[] raw = s.doReturningWork(c -> { + try (Statement st = c.createStatement(); + ResultSet rs = st.executeQuery("select cast(instant_col as varchar), cast(ldt_col as varchar), " + + "cast(odt_default_col as varchar), cast(odt_native_col as varchar), " + + "cast(odt_normalize_col as varchar), cast(odt_normalize_utc_col as varchar), " + + "cast(odt_column_col as varchar) from event where id = 1")) { + rs.next(); + String[] r = new String[7]; + for (int i = 0; i < 7; i++) { + r[i] = rs.getString(i + 1); + } + return r; + } + }); + + String writer = System.getProperty("dt.writerZone", "?").replace('/', '_'); + String variant = Db.phase().equals("read") ? "written-in-" + writer : "same-jvm"; + Transcript t = new Transcript("01-roundtrip", variant, product); + if (Db.phase().equals("read")) { + t.line("# written by another JVM whose default zone was " + System.getProperty("dt.writerZone") + + "; this JVM only reads (see scripts/run-all.sh)"); + } + t.line("# written: Instant " + MOMENT + ", LocalDateTime " + WALL + ", OffsetDateTime " + KOLKATA + + " (all the same moment; the LocalDateTime is the Kolkata wall clock)"); + t.line(row("Instant", MOMENT, e.getInstant(), raw[0])); + t.line(row("LocalDateTime", WALL, e.getLocalDateTime(), raw[1])); + t.line(row("OffsetDateTime default", KOLKATA, e.getOffsetDefault(), raw[2])); + t.line(row("OffsetDateTime NATIVE", KOLKATA, e.getOffsetNative(), raw[3])); + t.line(row("OffsetDateTime NORMALIZE", KOLKATA, e.getOffsetNormalize(), raw[4])); + t.line(row("OffsetDateTime NORMALIZE_UTC", KOLKATA, e.getOffsetNormalizeUtc(), raw[5])); + t.line(row("OffsetDateTime COLUMN", KOLKATA, e.getOffsetColumn(), raw[6])); + t.write(); + + // What must hold on every database and in every JVM zone: + assertThat(e.getInstant()).isEqualTo(MOMENT); + assertThat(e.getLocalDateTime()).isEqualTo(WALL); + for (OffsetDateTime o : new OffsetDateTime[] { e.getOffsetDefault(), e.getOffsetNative(), + e.getOffsetNormalizeUtc(), e.getOffsetColumn() }) { + assertThat(o.toInstant()).isEqualTo(MOMENT); + } + + // NORMALIZE stores a zone-less timestamp in the *writer's* JVM zone, so it keeps the instant + // only when the reading JVM has the same default zone as the writing JVM -- unless direct + // JDBC handling is on, which (observed) bypasses the normalisation altogether. + boolean sameZone = !Db.phase().equals("read") + || System.getProperty("dt.writerZone").equals(ZoneId.systemDefault().getId()); + assertThat(e.getOffsetNormalize().toInstant().equals(MOMENT)).isEqualTo(sameZone || Db.directJdbc()); + + // Offset identity. H2's TIMESTAMP WITH TIME ZONE keeps the offset; PostgreSQL's timestamptz stores + // only the instant, so NATIVE storage comes back expressed in UTC. COLUMN keeps the offset + // in a companion column on both. + ZoneOffset kolkataOffset = ZoneOffset.ofHoursMinutes(5, 30); + ZoneOffset nativeOffset = Db.kind().equals("postgres") ? ZoneOffset.UTC : kolkataOffset; + assertThat(e.getOffsetNative().getOffset()).isEqualTo(nativeOffset); + assertThat(e.getOffsetDefault().getOffset()).isEqualTo(nativeOffset); + assertThat(e.getOffsetColumn().getOffset()).isEqualTo(kolkataOffset); + if (!Db.directJdbc()) { + assertThat(e.getOffsetNormalizeUtc().getOffset()).isEqualTo(ZoneOffset.UTC); + } + + } + } + + static String row(String type, Object in, Object out, String raw) { + String same = "n/a "; + if (in instanceof OffsetDateTime a && out instanceof OffsetDateTime b) { + same = String.valueOf(a.toInstant().equals(b.toInstant())) + (a.toInstant().equals(b.toInstant()) ? "" : " "); + } + else if (in instanceof Instant) { + same = String.valueOf(in.equals(out)) + (in.equals(out) ? "" : " "); + } + return String.format("%-29s out %-27s | equals %-5s | same instant %-5s | raw %s", type, out, + in.equals(out), same, raw); + } +} diff --git a/date-time/src/test/java/com/ankurm/datetime/Transcript.java b/date-time/src/test/java/com/ankurm/datetime/Transcript.java new file mode 100644 index 0000000..d8b3a65 --- /dev/null +++ b/date-time/src/test/java/com/ankurm/datetime/Transcript.java @@ -0,0 +1,56 @@ +package com.ankurm.datetime; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.TimeZone; + +/** Collects lines and writes output/NN-name--[-]-.txt. */ +final class Transcript { + + static final String LABEL = System.getProperty("h.label", "h7"); + static final String VERSION = System.getProperty("h.version", "?"); + + private final List lines = new ArrayList<>(); + private final Path file; + + Transcript(String name, String variant, String dbProduct) { + String zone = TimeZone.getDefault().getID().replace('/', '_'); + String direct = System.getProperty("dt.directJdbc", "default"); + String suffix = direct.equals("default") ? "" : "-direct" + direct; + this.file = Path.of("output", name + "-" + Db.kind() + "-" + zone + + (variant.isEmpty() ? "" : "-" + variant) + suffix + "-" + LABEL + ".txt"); + line("# " + name + (variant.isEmpty() ? "" : " (" + variant + ")")); + line("# Hibernate ORM " + VERSION + ", JDK " + Runtime.version().feature() + + ", database " + dbProduct + ", JVM default zone " + TimeZone.getDefault().getID() + + ", java_time_use_direct_jdbc " + Db.directJdbc() + (direct.equals("default") ? " (default)" : " (set)")); + } + + static String product(Connection c) { + try { + return c.getMetaData().getDatabaseProductName() + " " + c.getMetaData().getDatabaseProductVersion(); + } + catch (SQLException ex) { + throw new IllegalStateException(ex); + } + } + + Transcript line(String s) { + lines.add(s); + return this; + } + + void write() { + try { + Files.createDirectories(file.getParent()); + Files.write(file, lines); + } + catch (IOException ex) { + throw new IllegalStateException(ex); + } + } +} diff --git a/date-time/src/test/java/com/ankurm/datetime/TypesTest.java b/date-time/src/test/java/com/ankurm/datetime/TypesTest.java new file mode 100644 index 0000000..013f6da --- /dev/null +++ b/date-time/src/test/java/com/ankurm/datetime/TypesTest.java @@ -0,0 +1,91 @@ +package com.ankurm.datetime; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.jupiter.api.*; + +import java.sql.ResultSet; +import java.sql.Statement; +import java.time.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; + +/** Same-JVM checks of the questions readers ask: @Column precision, java.util.Date, Year/YearMonth/Duration. */ +class TypesTest { + + @BeforeAll + static void needDatabase() { + Assumptions.assumeTrue(Db.available(), "dt.db=postgres but dt.pg.url is not set"); + Assumptions.assumeTrue(!Db.phase().equals("read") && !Db.phase().equals("write")); + } + + static List columnTypes(Session s, String table) { + return s.doReturningWork(c -> { + List out = new ArrayList<>(); + try (Statement st = c.createStatement(); + ResultSet rs = st.executeQuery("select column_name, data_type, datetime_precision from information_schema.columns " + + "where lower(table_name) = '" + table + "' and lower(table_schema) = 'public' order by ordinal_position")) { + while (rs.next()) { + out.add(String.format("%-26s %-28s precision %s", rs.getString(1).toLowerCase(), rs.getString(2).toLowerCase(), + rs.getString(3))); + } + } + return out; + }); + } + + @Test + void columnPrecisionAttributes() { + LocalDateTime in = LocalDateTime.of(2026, 6, 15, 14, 0, 0, 123_456_789); + try (SessionFactory sf = Db.open(true, Map.of(), PrecisionEvent.class)) { + sf.inTransaction(s -> s.persist(new PrecisionEvent(1L, in))); + try (Session s = sf.openSession()) { + PrecisionEvent out = s.find(PrecisionEvent.class, 1L); + Transcript t = new Transcript("08-column-precision", "", s.doReturningWork(Transcript::product)); + t.line("# written: " + in + " (nanos .123456789); generated column types, then what came back"); + columnTypes(s, "precision_event").stream().filter(l -> !l.startsWith("id ")).forEach(t::line); + t.line("default -> " + out.getDefaultPrecision()); + t.line("precision = 9 -> " + out.getPrecision9()); + t.line("secondPrecision = 9 -> " + out.getSecondPrecision9()); + t.line("secondPrecision = 3 -> " + out.getSecondPrecision3()); + t.line("Instant, secondPrecision = 9 -> " + out.getInstantSecondPrecision9()); + t.write(); + // secondPrecision = 3 keeps milliseconds only, whatever the database + assertThat(out.getSecondPrecision3().getNano()).isEqualTo(123_000_000); + // precision = 9 changes nothing relative to the default + assertThat(out.getPrecision9()).isEqualTo(out.getDefaultPrecision()); + } + } + } + + @Test + void legacyAndYearTypes() { + Date now = Date.from(Instant.parse("2026-06-15T08:30:00Z")); + try (SessionFactory sf = Db.open(true, Map.of(), Legacy.class)) { + sf.inTransaction(s -> s.persist(new Legacy(1L, now, Year.of(2026), YearMonth.of(2026, 6), Duration.ofMinutes(90)))); + try (Session s = sf.openSession()) { + Legacy out = s.find(Legacy.class, 1L); + Transcript t = new Transcript("09-legacy-types", "", s.doReturningWork(Transcript::product)); + t.line("# java.util.Date with no @Temporal, Year, YearMonth, Duration: generated column types and round trip"); + columnTypes(s, "legacy").stream().filter(l -> !l.startsWith("id ")).forEach(t::line); + t.line("java.util.Date in " + now.toInstant() + " | out " + out.getUtilDate().toInstant() + " | class " + out.getUtilDate().getClass().getName()); + t.line("java.util.Date in.equals(out) " + now.equals(out.getUtilDate()) + " | out.equals(in) " + out.getUtilDate().equals(now)); + t.line("Year in 2026 | out " + out.getYear()); + t.line("YearMonth in 2026-06 | out " + out.getYearMonth()); + t.line("Duration in PT1H30M | out " + out.getDuration()); + t.write(); + assertThat(out.getUtilDate().toInstant()).isEqualTo(now.toInstant()); + assertThat(out.getUtilDate()).isInstanceOf(java.sql.Timestamp.class); + assertThat(now.equals(out.getUtilDate())).isTrue(); + assertThat(out.getUtilDate().equals(now)).isFalse(); + assertThat(out.getYear()).isEqualTo(Year.of(2026)); + assertThat(out.getYearMonth()).isEqualTo(YearMonth.of(2026, 6)); + assertThat(out.getDuration()).isEqualTo(Duration.ofMinutes(90)); + } + } + } +} diff --git a/date-time/src/test/java/com/ankurm/datetime/ZonedTest.java b/date-time/src/test/java/com/ankurm/datetime/ZonedTest.java new file mode 100644 index 0000000..d5136e8 --- /dev/null +++ b/date-time/src/test/java/com/ankurm/datetime/ZonedTest.java @@ -0,0 +1,117 @@ +package com.ankurm.datetime; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.jupiter.api.*; + +import java.sql.ResultSet; +import java.sql.Statement; +import java.time.*; +import java.util.Map; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * ZonedDateTime on its own: what a named zone turns into, and the driver combination where it cannot + * be bound or read at all (PostgreSQL JDBC + java_time_use_direct_jdbc=true). + */ +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +class ZonedTest { + + static final Instant MOMENT = Instant.parse("2026-06-15T08:30:00Z"); + static final ZonedDateTime PARIS = ZonedDateTime.of(LocalDateTime.of(2026, 6, 15, 10, 30), ZoneId.of("Europe/Paris")); + + /** + * pgjdbc 42.7.x has no ZonedDateTime support for getObject/setObject. Hibernate 7.4 with direct JDBC + * switched on hands it the value anyway; the Hibernate 8 beta falls back to the legacy conversion. + */ + static boolean pgDirect() { + return Db.kind().equals("postgres") && Db.directJdbc() && Transcript.LABEL.equals("h7"); + } + + @BeforeAll + static void needDatabase() { + Assumptions.assumeTrue(Db.available(), "dt.db=postgres but dt.pg.url is not set"); + } + + @Test + @Order(1) + void write() { + Assumptions.assumeTrue(!Db.phase().equals("read")); + try (SessionFactory sf = Db.open(true, Map.of(), ZonedEvent.class)) { + ZonedEvent e = new ZonedEvent(1L); + e.setZonedDefault(PARIS); + e.setZonedColumn(PARIS); + if (!pgDirect()) { + sf.inTransaction(s -> s.persist(e)); + return; + } + // Expected failure #1: binding. + Transcript t; + try (Session s = sf.openSession()) { + t = new Transcript("04-zoned-failure", "", s.doReturningWork(Transcript::product)); + } + t.line("# ZonedDateTime on PostgreSQL with java_time_use_direct_jdbc=true"); + t.line("## persist(new ZonedEvent(zonedDefault = " + PARIS + "))"); + RuntimeException bind = org.junit.jupiter.api.Assertions.assertThrows(RuntimeException.class, + () -> sf.inTransaction(s -> s.persist(e))); + chain(t, bind); + // Expected failure #2: reading, even a row whose ZonedDateTime columns are NULL. + sf.inTransaction(s -> s.doWork(c -> { + try (Statement st = c.createStatement()) { + st.executeUpdate("insert into zoned_event (id) values (2)"); + } + })); + t.line("## find(ZonedEvent.class, 2) -- a row whose ZonedDateTime columns are NULL"); + RuntimeException read = org.junit.jupiter.api.Assertions.assertThrows(RuntimeException.class, + () -> sf.inTransaction(s -> s.find(ZonedEvent.class, 2L))); + chain(t, read); + t.write(); + } + } + + @Test + @Order(2) + void read() { + Assumptions.assumeTrue(!Db.phase().equals("write")); + Assumptions.assumeTrue(!pgDirect(), "bind and read failures are recorded by write(), see 04-zoned-failure"); + try (SessionFactory sf = Db.open(false, Map.of(), ZonedEvent.class); Session s = sf.openSession()) { + String product = s.doReturningWork(Transcript::product); + ZonedEvent e = s.find(ZonedEvent.class, 1L); + String[] raw = s.doReturningWork(c -> { + try (Statement st = c.createStatement(); + ResultSet rs = st.executeQuery("select cast(zdt_default_col as varchar), " + + "cast(zdt_column_col as varchar) from zoned_event where id = 1")) { + rs.next(); + return new String[] { rs.getString(1), rs.getString(2) }; + } + }); + String writer = System.getProperty("dt.writerZone", "?").replace('/', '_'); + String variant = Db.phase().equals("read") ? "written-in-" + writer : "same-jvm"; + Transcript t = new Transcript("04-zoned", variant, product); + t.line("# written: " + PARIS + " (instant " + MOMENT + ")"); + t.line(row("ZonedDateTime default", e.getZonedDefault(), raw[0])); + t.line(row("ZonedDateTime COLUMN", e.getZonedColumn(), raw[1])); + t.write(); + + assertThat(e.getZonedDefault().toInstant()).isEqualTo(MOMENT); + assertThat(e.getZonedColumn().toInstant()).isEqualTo(MOMENT); + // A named zone never comes back: Europe/Paris is gone, only an offset or the JVM zone remains. + assertThat(e.getZonedDefault().getZone()).isNotEqualTo(ZoneId.of("Europe/Paris")); + assertThat(e.getZonedColumn().getZone()).isNotEqualTo(ZoneId.of("Europe/Paris")); + } + } + + private static String row(String type, ZonedDateTime out, String raw) { + return String.format("%-22s out %-32s | equals %-5s | same instant %-5s | zone %-16s | raw %s", type, out, + PARIS.equals(out), PARIS.toInstant().equals(out.toInstant()), out.getZone(), raw); + } + + private static void chain(Transcript t, Throwable ex) { + Throwable c = ex; + while (c != null) { + t.line(c.getClass().getName() + ": " + String.valueOf(c.getMessage()).replace("\n", " ")); + c = c.getCause(); + } + } +}