-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Using same Parameter for LIKE and = the equals check will always fail [DATAJPA-1627] #1929
Labels
status: superseded
An issue that has been superseded by another
Comments
I came across this behavior recently and I'd like to contribute a fix for it (should a fix be desired). @schauder are you currently engaged on this issue, and would you mind if I took it? |
A fix for this would be very welcome. |
@lorentzforces If you're still interested, I'd suggest beginning with writing a simple test case that exposes this issue then working your way toward a solution. |
klajdipaja
added a commit
to klajdipaja/spring-data-jpa
that referenced
this issue
Mar 10, 2023
…equals comparison and a LIKE comparison. Relates to spring-projects#1929
klajdipaja
added a commit
to klajdipaja/spring-data-jpa
that referenced
this issue
Mar 10, 2023
…eplacing the provided parameter in a StringQuery with a new name or index when the named or indexed parameter is used more then once in the query. Closes spring-projects#1929
klajdipaja
added a commit
to klajdipaja/spring-data-jpa
that referenced
this issue
Mar 10, 2023
klajdipaja
added a commit
to klajdipaja/spring-data-jpa
that referenced
this issue
Mar 24, 2023
…eplacing the provided parameter in a StringQuery with a new name or index when the named or indexed parameter is used more then once in the query. Closes spring-projects#1929
klajdipaja
added a commit
to klajdipaja/spring-data-jpa
that referenced
this issue
Mar 24, 2023
…eplacing the provided parameter in a StringQuery with a new name or index when the named or indexed parameter is used more then once in the query. Closes spring-projects#1929
Superceded by #3041. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jonasblumer opened DATAJPA-1627 and commented
Using the same parameter for an equals comparison and a LIKE comparison will always pre- and append
%
to the parameter making the equals comparison always fail.@Query("SELECT * FROM User u WHERE u.name = :term OR u.username LIKE %:term%") List<Users> getUsers(final String term);
The parameter, when calling this with
getUsers("Jonas")
and checking SQL logging, is%Jonas%
, which means the= :term
check will always failNo further details from DATAJPA-1627
The text was updated successfully, but these errors were encountered: