Skip to content
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

Force to coalesce be more genereic #683

Closed
kamilkrzywanski opened this issue Nov 15, 2024 · 1 comment
Closed

Force to coalesce be more genereic #683

kamilkrzywanski opened this issue Nov 15, 2024 · 1 comment

Comments

@kamilkrzywanski
Copy link
Contributor

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.

Copy link
Contributor

This issue has been automatically closed because the author did not indicate they are willing to put in the effort needed to resolve it.

kamilkrzywanski pushed a commit to kamilkrzywanski/querydsl_feign that referenced this issue Nov 15, 2024
kamilkrzywanski added a commit to kamilkrzywanski/querydsl_feign that referenced this issue Nov 23, 2024
velo pushed a commit that referenced this issue Nov 25, 2024
* Fix coalesce - requires exact type issue #683

* Fix coalesce - requires exact type issue #683

---------

Co-authored-by: kkrzywanski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant