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
{{ message }}
Repository navigation
Add JpaSpecificationExecutor.delete(…) and ….deleteAll(…) [DATAJPA-907] #1262
I have to delete massive entities. And I cannot add deleteByXxxxx(...) to repository by some reason. So, I implemented deleteAll(Specification) myself for general-purpose. I think it would be nice that JpaSpecificationExecutor has deleteAll(Specification) interface.
Please consider this.
Example for SimpleJpaRepository (Worked with transaction)
The reason that this is not implemented yet is that we're currently still JPA 2.0 compatible on the API level. ….createCriteriaDelete(…) was introduced in JPA 2.1. So with the introduction of the suggested method on JpaSpecificationExecutor we'd basically have to implement the method in a way that — if called on a JPA 2.0 EntityManager — would fail with a NoSucheMethodError. What also plays into this is that e.g. for OpenJPA, there's not even a JPA 2.1 compatible implementation available.
I am a bit torn here. Spring Framework 4 still supports Hibernate 3 versions, so I am assuming that there's a decent user base on Hibernate versions < 4.3 (the one that introduced JPA 2.1 support). I'll take this forward to the team and see what we can do
Activity
spring-projects-issues commentedon May 31, 2016
Oliver Drotbohm commented
The reason that this is not implemented yet is that we're currently still JPA 2.0 compatible on the API level.
….createCriteriaDelete(…)was introduced in JPA 2.1. So with the introduction of the suggested method onJpaSpecificationExecutorwe'd basically have to implement the method in a way that — if called on a JPA 2.0EntityManager— would fail with aNoSucheMethodError. What also plays into this is that e.g. for OpenJPA, there's not even a JPA 2.1 compatible implementation available.I am a bit torn here. Spring Framework 4 still supports Hibernate 3 versions, so I am assuming that there's a decent user base on Hibernate versions < 4.3 (the one that introduced JPA 2.1 support). I'll take this forward to the team and see what we can do
spring-projects-issues commentedon May 31, 2016
SPT Developer commented
I see. I expect future update. Thank you!
s-jepsen commentedon Mar 3, 2021
Any plans on implementing this anytime soon?
Introduce delete(Specification) on JpaSpecificationExecutor.