-
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
LikeParameterBinding does not function properly when same parameter used multiple times [DATAJPA-873] #1230
Comments
Eric Sirianni commented Strangely, I am not hitting this assertion: private static final String MESSAGE = "Already found parameter binding with same index / parameter name but differing binding type! "
+ "Already have: %s, found %s! If you bind a parameter multiple times make sure they use the same binding.";
private static void checkAndRegister(ParameterBinding binding, List<ParameterBinding> bindings) {
for (ParameterBinding existing : bindings) {
if (existing.hasName(binding.getName()) || existing.hasPosition(binding.getPosition())) {
Assert.isTrue(existing.equals(binding), String.format(MESSAGE, existing, binding));
}
}
if (!bindings.contains(binding)) {
bindings.add(binding);
}
} |
Exactly the same issue as mine. Currently to overcome this i use a different named parameter for each usage. |
Hello @gregturn, I am upgrading from Spring Boot 3.0.9 to 3.1.3 and I'm having the same issue on this query (which was working perfectly before):
What's surprising is that I'm using I also tried without using I think the difference is that the last parameter is a list and that confuses the validator. |
Same here, with boot - id 'org.springframework.boot' version '3.1.2'
+ id 'org.springframework.boot' version '3.1.3' Symptoms same as in prev comment #1230 (comment) |
Actually , I have same situation in my query when I have upgraded to new version, I'm getting exactly this the error you are discussing. |
@alirezaalallah, @alianman, @SamTV12345, @leo-jeff-app this has been resolved in |
As this is |
Yes. Same case. I can't rollout snapshots in production 😄 . But great that this is presumably fixed in 3.1.4 |
Eric Sirianni opened DATAJPA-873 and commented
In the following example (native query):
The
LikeParameterBinding
does not properly translate the second usage of the:myParam
parameter. If I remove the first usage of the:myParam
parameter, the query behaves as intended1 votes, 2 watchers
The text was updated successfully, but these errors were encountered: