We have a spring boot 3.1.0 version application where we have JPA based OData APIs with Apache Olingo Java V2 library. The hibernate-core version currently is 6.2.2; and odata API with filter on Enum property which has ordinals maintained in DB works fine.
Upon upgrading spring boot to version 3.2.6, the odata API with filter doesn’t work anymore. Hibernate-core version after upgrade is 6.4.8.
Below API doesn’t work anymore:
/api/v1.0/odata/status?$format=json&$filter=type ne ‘NEW’
with error:
class java.lang.IllegalArgumentException : org.hibernate.query.SemanticException: Operand of ‘like’ is of type ‘EnumType’ which is not a string (its JDBC type code is not string-like)
However, if the operator is “eq”, it works fine:
/api/v1.0/odata/status?$format=json&$filter=type eq ‘NEW’
Here, ‘NEW’ is a valid Enum value for that Enum type.
Is this a bug with hibernate 6.4.8 and a correction available? Or any workarounds? Please suggest.