Reputation: 1215
Trying to create a saveAll method for an Iterable of entites.
Full error is Failed to create query method public abstract java.lang.Iterable com.myCompany.mappingPoc.ConnectionManagerRepo.saveAll(java.lang.Iterable)! No property saveAll found for type ConnectionManager!
@Repository
public interface ConnectionManagerRepo extends CrudRepository<ConnectionManager, Long> {
Iterable<ConnectionManager> findAllByControlId(Long controlId);
Page<ConnectionManager> findAllByControlId(Pageable p, Long controlId);
Iterable<ConnectionManager> saveAll(Iterable<ConnectionManager> connectionManagers);
}
Upvotes: 3
Views: 6046
Reputation: 81907
As C. Weber writes in his comment
CrudRepository already has a
<S extends T> Iterable<S> saveAll(Iterable<S> entities);
You don't need to specify your own.
You seem to expect some kind of query derivation happening here, but that mechanism only works for methods starting with find
, exists
, count
and delete
.
Upvotes: 5