Add enums module: enum mapping in Hibernate 7.4.17.Final (ORDINAL trap, STRING, PostgreSQL native enum, AttributeConverter, @EnumeratedValue), what release 2 reads and writes after a constant is inserted, appended or renamed, hbm2ddl=update limits, migrations (H2 2.4.240, PostgreSQL 18.6)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b5y3ArhRbakfu1ELsP
This commit is contained in:
Claude
2026-11-19 23:00:31 +05:30
parent 0db721805b
commit bd0f33a306
22 changed files with 1785 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# Adding CANCELLED, then starting release 2 with hbm2ddl=update: is the schema fixed?
# Hibernate ORM 7.4.17.Final, H2 2.4.240 and PostgreSQL 18.6, JDK 25
== H2
-- ORDINAL
after update: column type: TINYINT
after update: check: "STATUS" BETWEEN 0 AND 2
write CANCELLED : FAILS Check constraint violation: "CONSTRAINT_8: "; SQL statement:
-- STRING
after update: column type: ENUM
write CANCELLED : FAILS Value not permitted for column "('NEW', 'PAID', 'SHIPPED')": "CANCELLED"; SQL statement:
== PostgreSQL 18
-- ORDINAL
after update: column type: smallint
after update: check: CHECK (((status >= 0) AND (status <= 2)))
write CANCELLED : FAILS ERROR: new row for relation "orders" violates check constraint "orders_status_check"
-- STRING
after update: column type: character varying(255)
after update: check: CHECK (((status)::text = ANY ((ARRAY['NEW'::character varying, 'PAID'::character varying, 'SHIPPED'::character varying])::text[])))
write CANCELLED : FAILS ERROR: new row for relation "orders" violates check constraint "orders_status_check"
-- NAMED_ENUM
after update: column type: statusv1
write CANCELLED : FAILS ERROR: invalid input value for enum statusv1: "CANCELLED"