Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HHH-17680 Reproducer #400

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cwitteveen-cofano
Copy link

@cwitteveen-cofano cwitteveen-cofano commented Jul 8, 2024

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)
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant