In parseParameterBindingsOfQueryIntoBindingsAndReturnCleanedQuery, the matcher is referencing the parsed query.
Matcher matcher = PARAMETER_BINDING_PATTERN.matcher(resultingQuery);
When checking for quotes in the matched parameters, the matcher passes its own indexes from the parsed query to the spelExtractor.isQuoted method which references the original non-parsed query.
if (spelExtractor.isQuoted(matcher.start())) {
continue;
}
By coincidence it appears the start index of some of your parameters in the parsed query match the start index of quotes in the original query.
Thus, the above lines skip binding the parameters which results in the named parameter not bound exception.
I was able to get your test to pass by changing the names of some parameters in the filter slightly.
.
Originally posted by @mfedirko in https://github.com/spring-projects/spring-framework/issues/22450#issuecomment-467665886
Comment From: felixng1028
I have encountered this issue many times, could Spring team help to fix this issue ASAP ?
Comment From: felixng1028
Same behavior as https://github.com/spring-projects/spring-framework/issues/22450#issue-412862540
Comment From: odrotbohm
Would you mind filing this in the Spring Data JPA issue tracker? Also, screenshots do not help that much. Please provide at least a stack trace and a bit code that's actually causing the issue.
Comment From: felixng1028
https://jira.spring.io/browse/DATAJPA-1683