Add json-columns module: JSON columns in Hibernate 7.4.14 (@JdbcTypeCode(SqlTypes.JSON)), JSONB querying, GIN/expression indexes, dirty checking, Jackson 3 vs 2 on PostgreSQL 18.6 and MySQL 8.0.46

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b6Kg9RWSTJzyz6KP9X
This commit is contained in:
Claude
2026-10-30 17:00:46 +00:00
parent 98f4ed7411
commit b83cc9988e
51 changed files with 3178 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# PostgreSQL 18.6 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
# Hibernate 7.4.14.Final
== CREATE TABLE as Hibernate emits it (JPA script generation, nothing executed)
create table t_coldef_json (id bigint generated by default as identity, doc json, primary key (id));
create table t_coldef_jsonb (id bigint generated by default as identity, doc jsonb, primary key (id));
create table t_default (id bigint generated by default as identity, doc jsonb, primary key (id));
create table t_jdbctype_json (id bigint generated by default as identity, doc jsonb, primary key (id));
create table t_jdbctype_jsonb (id bigint generated by default as identity, doc jsonb, primary key (id));
create table t_list (id bigint generated by default as identity, items jsonb, primary key (id));
== information_schema after hbm2ddl=create (column, data_type)
t_coldef_json.doc | json
t_coldef_jsonb.doc | jsonb
t_default.doc | jsonb
t_jdbctype_json.doc | jsonb
t_jdbctype_jsonb.doc | jsonb
t_list.items | jsonb
== what is stored: pg_typeof(doc) and the text PostgreSQL returns
t_default | jsonb | {"a": 1, "b": ["x", "y"]}
t_coldef_json | json | {"a": 1, "b": ["x", "y"]}
t_coldef_jsonb | jsonb | {"a": 1, "b": ["x", "y"]}
t_jdbctype_json | jsonb | {"a": 1, "b": ["x", "y"]}
t_jdbctype_jsonb | jsonb | {"a": 1, "b": ["x", "y"]}
t_list | jsonb | ["p", "q"]
== reading each variant back through Hibernate
t_default -> {a=1, b=[x, y]}
t_coldef_json -> {a=1, b=[x, y]}
t_jdbctype_json-> {a=1, b=[x, y]}
== json vs jsonb is observable: key order, duplicate keys and whitespace
json | jsonb: {"z": 1, "a": 2, "a": 3} | {"a": 3, "z": 1}
json = json: ERROR: operator does not exist: json = json
jsonb = jsonb: t