kiwiproject / kiwi

A set of Java utilities that we could not find in Guava or Apache Commons...or we just felt like having our own version.
MIT License
12 stars 1 forks source link

Deprecate AbstractArrayUserType, BigintArrayUserType, and TextArrayUserType for removal #1117

Closed sleberknight closed 7 months ago

sleberknight commented 7 months ago

Hibernate 6 supports arrays natively now, so there is no longer a need for us to have custom array UserType classes in kiwi.

Deprecate this and its two sub-classes for removal in a future version.

For information on Hibernate 6's support for arrays, see Collections mapped to SQL arrays in An Introduction to Hibernate 6.

Another resource is: https://in.relation.to/2022/06/24/hibernate-orm-61-features/

In addition, there is an issue using this starting after Postgres 14 where we encountered a ClassCastException when using these custom types in our entity classes. Here are a few of the resources I found:

So, these custom user types stop working when using Hibernate 6 and Postgres 15+. Another reason to remove them.

sleberknight commented 7 months ago

The actual exception message included the following:

ArrayUserTypesIntegrationTest.beforeAll:36 » ClassCast class org.hibernate.type.CustomType cannot be
                cast to class org.hibernate.type.BasicPluralType (org.hibernate.type.CustomType and
                org.hibernate.type.BasicPluralType are in unnamed module of loader 'app')