I have create findAll function with return type Slice then got this error:
The return type is incompatible with PagingAndSortingRepository<Book,Long>.findAll(Pageable)
Here is my code in repository:
import org.springframework.data.domain.Slice;
@SuppressWarnings("unused")
@Repository
public interface BookRepository extends JpaRepository<Book, Long>, JpaSpecificationExecutor<Book> {
Slice<Book> findAll(Pageable pageable);
}
What did I do wrong here?
Answer from M. Deinum in comment
That method is already available in the JpaRepository and returns a Page you >cannot redifine it with another return type and you don't actually need it >because it is already there.