FunctionArgumentException after hibernate upgrade to v6.4.4

Description

We have a model with a boolean field like this

We have this code in our project

When the fieldName refers to the boolean field we now get this error :

Activity

Show:

Jyri-Matti Lähteenmäki August 12, 2024 at 10:37 AM

Hi, I just tried this with Hibernate 6.6.0.Final (CR1 didn’t work due to HHH-18108). This seems to work and the proposal looks elegant to me, so thank you!

Gavin King June 13, 2024 at 8:02 PM

Boolean is now treated as comparable, and all this stuff can be controlled via the JdbcType.

Gavin King June 13, 2024 at 3:15 PM

OK, , since you asked so politely, here’s my proposal

This would let you override isComparable() on a custom JdbcType.

Jyri-Matti Lähteenmäki May 20, 2024 at 12:40 PM

Hello,

we have some custom Hibernate types which are comparable, and corresponding Oracle types in the database which are also comparable. Seems that in Hibernate 6 we cannot use those types as comparable in queries anymore. This used to work in Hibernate < 6.

Would you be willing to add some kind of possibility to allow any Comparable type to be comparable also in queries? Maybe provide a way with a configuration flag to disable the assertion, or provide some way to register “database-comparable” types? Any other ideas?

Thanks!

Richard King April 27, 2024 at 10:27 AM
Edited

Hello,

From our perspective it would be ideal if it could work like it used to i.e. if checkArgumentType() could consider Boolean (and boolean type) to be “COMPARABLE types”, then we would not need to alter our own code.

Please note that the issue applies when using “min” as well as when using “max”, the change to ArgumentTypesValidator would fix both of these I assume?

If you add the any() and every() to the HibernateCriteriaBuilder as well then we may use that.

Thankyou for your help with this.

Richard

Fixed

Details

Assignee

Reporter

Worked in

Components

Fix versions

Affects versions

Priority

Created April 26, 2024 at 1:35 PM
Updated August 12, 2024 at 10:37 AM
Resolved June 13, 2024 at 8:02 PM