-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Ambiguous query generation with null-valued parameters in like-queries #2653
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
Milestone
Comments
yura2201
added a commit
to yura2201/spring-data-jpa
that referenced
this issue
Oct 3, 2022
…g for string params. Fixes spring-projects#2653 Related tickets spring-projects#2548
4 tasks
gregturn
added a commit
that referenced
this issue
Nov 7, 2022
gregturn
added a commit
that referenced
this issue
Nov 9, 2022
Backported to |
@yura2201 Feel free to test out the snapshots. |
@gregturn hey! it looks good, but I didn't succeed to find a proper snapshot in a snapshot-repo for |
https://repo.spring.io/ui/native/libs-snapshot/org/springframework/data/spring-data-jpa/2.7.6-SNAPSHOT/ was published on 11/9/2022. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
Actually the issue 2548 has not been completely resolved!
PersistenceProvider#condense(Object)
returns an empty string, so then the query@Query(SELECT t FROM My_Table t WHERE (:param is NULL or t.attr LIKE %:param%))
will transform into
select my_table.id, ..., my_table.attr as attrN from my_table where '%%' is null or my_table.attr like '%%'
whereas in spring-data-jpa 2.6.4 or earlier it will transform toselect my_table.id, ..., my_table.attr as attrN from my_table where NULL is null or my_table.attr like NULL
The text was updated successfully, but these errors were encountered: