-
-
Notifications
You must be signed in to change notification settings - Fork 76
Description
In project, the coalesce method has two variations:
coalesce(Expression expr), which is typesafe
coalesce(Expression<?>... exprs), which is not strictly typesafe
Under Hibernate 5, both methods functioned as expected. However, during migration to Hibernate 6, it appears that Hibernate now enforces stricter type safety requirements. This change causes compatibility issues, resulting in errors such as:
java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected CHAR got NUMBER
Could not prepare statement [incompatible data types in combination in statement]
These errors suggest that the second method (coalesce(Expression<?>... exprs)) now requires type safety, even when used with mixed or dynamic types.
Reproduction Steps
Apply the attached patch to your project:
coalesce_bug.patch
Run the tests.
This should reproduce the issue, demonstrating the impact of Hibernate 6’s stricter type requirements.