hibernate-test-case-templates
hibernate-test-case-templates copied to clipboard
HHH-17680 Reproducer
When the Entity with @JdbcTypeCode(SqlTypes.ARRAY) the types of the fields are different than when the Entity with @JdbcTypeCode(SqlTypes.JSON) is loaded first.
If @JdbcTypeCode(SqlTypes.JSON) is loaded first, all subsequent fields of the same java type will be mapped to json.
EntityArray loaded first
Hibernate:
create table EntityArray (
id bigint not null,
listInteger integer array,
listString varchar(255) array,
primary key (id)
)
Hibernate:
create table EntityJSON (
id bigint not null,
listInteger json,
listString json,
primary key (id)
)
Hibernate:
create table EntityPlain (
id bigint not null,
listInteger integer array,
listString varchar(255) array,
primary key (id)
)
EntityJSON loaded first
Hibernate:
create table EntityArray (
id bigint not null,
listInteger json,
listString json,
primary key (id)
)
Hibernate:
create table EntityJSON (
id bigint not null,
listInteger json,
listString json,
primary key (id)
)
Hibernate:
create table EntityPlain (
id bigint not null,
listInteger json,
listString json,
primary key (id)
)
EntityPlain loaded first
Hibernate:
create table EntityArray (
id bigint not null,
listInteger integer array,
listString varchar(255) array,
primary key (id)
)
Hibernate:
create table EntityJSON (
id bigint not null,
listInteger json,
listString json,
primary key (id)
)
Hibernate:
create table EntityPlain (
id bigint not null,
listInteger integer array,
listString varchar(255) array,
primary key (id)
)