Dear Spring JPA Framework,

While upgrading from Spring 3.4.x to spring 3.5.x, I notice a regression issue while calling issueRepository.deleteAllInBatch() of a JpaRepository object. We are now facing the following error:

Caused by: java.lang.IllegalArgumentException: You have attempted to set a value of type class java.util.Vector for parameter 1 with expected type of class com.issue.IssueTable from query string delete from IssueTable x where x IN (?1).

While investigating the root cause, I notice the following commit which could have introduce the side effect.

https://github.com/spring-projects/spring-data-jpa/commit/96968e91eb641aeaf9c50f5716fe30f94f7adc62

I tried to use the issueRepository.deleteAllByIdInBatch() method which also does not work and throws the following error:

Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 3.0.4.v202310250740): org.eclipse.persistence.exceptions.JPQLException Exception Description: Problem compiling [delete from IssueTable x where id in :ids]. [31, 33] The identification variable 'id' is not defined in the FROM clause.

I guess there is a missing "x." before the id in the generated SQL.

I have attached 3 java files (1 entity, 1 repository, 1 unit test) + pom in order to reproduce the issue.

Best regards, Joel

IssueRepository.java IssueTable.java SpringJPAIssueTest.java

pom.xml.txt

Comment From: bclozel

If you believe the issue is in spring-data-jpa, please raise this against the project repository. Thanks!