You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
@Query(value = """
/* select and joins */
where
and (:encryptedEmail = '' or :encryptedEmail is null or c.encrypted_email = :encryptedEmail) \
and (:name = '' or :name is null or cp.name like %:name%) \
and (org.id in :ids or coalesce(:ids) is null)
""", nativeQuery = true)
List<View> findAll(String encryptedEmail, String name, List<Integer> ids);
Caused by: java.lang.IllegalArgumentException: Already found parameter binding with same index / parameter name but differing binding type; Already have: ParameterBinding [identifier: ids, origin: MethodInvocationArgument[identifier=ids]], found ParameterBinding [identifier: ids, origin: MethodInvocationArgument[identifier=ids]]; If you bind a parameter multiple times make sure they use the same binding
at org.springframework.util.Assert.isTrue(Assert.java:122)
What's surprising is that I'm using encryptedEmail and name twice in both clauses, yet the error arises only for the third clause containing ids. Has this been fixed only for certain cases?
I also tried without using coalesce: :ids is null or org.id in :ids and I'm getting the same error. I also tried inverting the where clauses, putting the last one in a different position, and I have the same error only on the statement containing :ids.
I also tried going old school and using ?1, ?2, and ?3 instead of the variable names, but I also get the same error with identifier: 3 this time.
I think the difference is that the last parameter is a list and that confuses the validator.
Looks like a duplicate of #3126. Care to upgrade to the latest Spring Data JPA snapshot (3.1.4-SNAPSHOT) and retest, whether the fix addresses your issue?
Hello,
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
encryptedEmail
andname
twice in both clauses, yet the error arises only for the third clause containingids
. Has this been fixed only for certain cases?I also tried without using
coalesce
::ids is null or org.id in :ids
and I'm getting the same error. I also tried inverting the where clauses, putting the last one in a different position, and I have the same error only on the statement containing:ids
.I also tried going old school and using
?1
,?2
, and?3
instead of the variable names, but I also get the same error withidentifier: 3
this time.I think the difference is that the last parameter is a list and that confuses the validator.
Originally posted by @falcononrails in #1230 (comment)
The text was updated successfully, but these errors were encountered: