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

[hypersistence-63 V.7.3.2] org.hibernate.type.SqlTypes code: 1111 #701

Closed
RomuDeuxfois opened this issue Feb 16, 2024 · 5 comments
Closed

Comments

@RomuDeuxfois
Copy link

Describe the bug
I have a java class with a array type property

  @Type(StringArrayType.class)
  @Column(name = "endpoint_ips")
  private String[] ips;

Everything works fine with hypersistence-utils-hibernate-63 version 3.7.0.
But when I try to run my app with the version 3.7.2 I have this error :

Unable to determine SQL type name for column 'endpoint_ips' of table 'assets': No type mapping for org.hibernate.type.SqlTypes code: 1111 (OTHER)

To Reproduce

Have a java class with an array type, I think it's enough.

Expected behavior

No error.

@yasin-herken
Copy link

You can look into https://hibernate.atlassian.net/browse/HHH-17588.

@vladmihalcea
Copy link
Owner

vladmihalcea commented Feb 16, 2024

@RomuDeuxfois Because of the HHH-17588 issue, the ArrayType uses the JDBC Types.OTHER, as the Types.ARRAY one will not work at all with Hibernate 6.4.

However, all the array tests work just fine with Hibernate 6.4, so you can use those as a reference of what could be done. If you have a distinct use case that's not covered by the current test cases, then you should provide a replicating test case for it.

@RomuDeuxfois
Copy link
Author

Thank you very much for your quick responses.
I will come back to you after testing.

@RomuDeuxfois
Copy link
Author

I followed your test example

  @Type(StringArrayType.class)
  @Column(name = "endpoint_ips", columnDefinition = "text[]")
  private String[] ips;

But it appears that the DB schema is created manually in SQL before hibernate (with flyway).
Which results in a type mismatch :

Schema-validation: wrong column type encountered in column [endpoint_ips] in table [assets]; found [_text (Types#ARRAY)], but expecting [text[] (Types#OTHER)]

image

@vladmihalcea
Copy link
Owner

Then, this issue is a duplicate of #697. Check out that issue for more details about how you can work around it.

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

No branches or pull requests

3 participants