-
Notifications
You must be signed in to change notification settings - Fork 369
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
ArrayType causes org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column found (Types#ARRAY), but expecting (Types#OTHER) with Hibernate 6.3 and 6.4 #697
Comments
The validation will no longer work since without using If HHH-17588 will be fixed, then we can switch back to |
Just as a reference: I got affected by the same when upgrading from 3.7.0 to 3.7.2 with Hibernate 6.4 (which I think wasn't fully supported before :) |
This issue is a side effect of #698. However, without it, you wouldn't be able to use the ArrayTypes from this library at all with Hibernate 6.4. Check out my previous message for more details about it. |
Yes... I've tried moving to native array, but then when I trigger an update my enums try to get mapped to positional enum. |
You should open a Hibernate issue then. In the long run, it's better to have the native Type support everything this library has been supporting. |
@vladmihalcea when you say "native Type support", it's implementation of UserType<String[]> for example ? (for a array of string) Do you confirm your fix make it works better with Hibernate 6.4+ and only validation fail ? |
Native Type support is what Hibernate ORM offers by default without the need for custom UserType implementations. The tests in the 63 module are running fine on Hibernate 6.4. That's the only thing I can confirm. If there are other issues, they will have to be replicated with additional integration tests. If your project has integration tests for the entire data access logic, then you will know for sure whether a native Type or a custom one works or not. That's thr only confirmation that really matters. |
Sure ! Thank you for fast answering ! Just wanted to know there is no known regression than the validation. |
The only known regressions are the ones for which there are Open issues on GitHub. There might be unknown regressions, of course. |
Hi @vladmihalcea , I am facing the similar issue The code we have
What is your suggestion to change this using Hibernate native support |
@kth13 Remove the |
@vladmihalcea It worked, thanks a lot. |
Great. The native Hibernate Type should be fine in many situations. |
How to implement array of SQL enum in 6.4?
Native Type support cause the following error on saving: |
@Javasick There is a |
how about hibernate 6.5 ? This solution does not work with hibernate 6.5 |
It works just fine with Hibernate 6.5. The 63 module is built with Hibernate 6.5. |
for this definition :
hibernate 6.5 and 63 module (version 3.8.2) I'm getting : |
@hahosseini Well, you said that the Now, it's obvious that you are getting that The only way to get rid of that warning is if you fix HHH-17588 in Hibernate. Be the change you want to see in this world! |
@vladmihalcea i still have the same issue => Schema-validation: wrong column type encountered in column [valeurs] in table [champs_composant_specifiques]; found [_text (Types#ARRAY)], but expecting [text[] (Types#OTHER)] @type(value = StringArrayType.class) CREATE TABLE champs_composant_specifiques ( |
Describe the bug
When I upgrade from
hypersistence-utils-hibernate-62:3.7.1
to
hypersistence-utils-hibernate-63:3.7.1
The following code:
Throws this error:
org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [houses] in table [dok_card]; found [_house (Types#ARRAY)], but expecting [house[] (Types#OTHER)]
My hibernate version is
6.4.1.Final
.To Reproduce
Follow the instructions here: https://vladmihalcea.com/postgresql-array-java-list/ with the latest version of hibernate and hypersistence-utils.
Expected behavior
No error is thrown when using a postgresql array of enums with a java list.
The text was updated successfully, but these errors were encountered: