-
Notifications
You must be signed in to change notification settings - Fork 866
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
Generated JPA query with incorrect argument binding indexes #2816
Comments
@F43nd1r should we look into this issue before 5.x? |
I confirm the issue was present before
|
@jwgmeligmeyling looked into it. Correctly fixing this is very involved. I would go ahead with 5.0 first and then someone can look into how to support custom hibernate types. |
I'm all for ripping out premature optimizations. So I am fine with using multiple parameters for the same value. ORMs, JDBC drivers and Query Engine Optimizers are perfectly capable of optimizing on their own. |
An unfortunate side effect of delaying the fix is that we will probably need a 6.0 (due to a signature change in the serializer). The specific signature change already caused quite a bit of fuzz for people using modern |
In that case |
Or we simply inverse it: labelToConstant. The label will always be unique. I'll see if I can have a look before the weekend. |
I do see now that such a change would break my personal integrations 😢 So there probably will be others. Not that sure about this change anymore... |
Closing as duplicate of #1413 |
@F43nd1r apparently someone already did the work in https://github.com/querydsl/querydsl/pull/2000/files (largely outdated PR though, and conflicts with the fix for #2326 provided in #2354 , |
Working like a charm with the latest and greatest |
Observed vs. expected behavior
Given an
JPA
entity with two boolean fields, one of them annotated with a custom type@Type
, when querying by those two fields providing the same boolean value (true, true
orfalse, false
) the generated query ends up using?1
for both arguments (as they are considered a constant).The generated query is
when the expected would be
Steps to reproduce
Here is a sample application to reproduce the problem, with some tests and loggers enabled to show the differences between the generated query and the expected one.
https://github.com/didiez/hibernate-querydsl-type-binding-bug
Environment
Querydsl version:
4.4.0
Querydsl module:
querydsl-jpa
Database: tested against
oracle 11g
andh2
(probably database agnostic)JDK: 11
Additional details
Might be related to the changes applied to fix #2326 (PR #2354)
The text was updated successfully, but these errors were encountered: