Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't JpaRepository have a saveAll method in Spring Data Jpa?

I'm extending JpaRepository in my code and I can't use the saveAll method even though it is in CrudRepository, which is extended by PagingAndSortingRepository, which is in turn extended by JpaRepository.

When I try to use the method as repository.saveAll(someIterable) my IDE can't find it, and if I try to override it in my repository interface as below I still get an error saying that the method doesn't override a method from a superclass.

@Override
Iterable<MyEntity> saveAll(Iterable<MyEntity> d);

Trying to compile obviously gives a compilation error. Anybody knows why?

like image 1000
Filippo De Angelis Avatar asked Oct 23 '25 08:10

Filippo De Angelis


1 Answers

saveAll() was not included in v1 of spring-data-jpa and didn't make its way into Spring Boot until March 2018 with the 2.0.0 release. Check your dependencies; you're likely using an older version.

like image 162
Matt Avatar answered Oct 24 '25 22:10

Matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!