已经有一个关于使用ReactiveCrudRepository
的分页问题的问题。被接受的解决方案适用于遵循findBy
格式的查询。该项目文档也提到了这种用法:
问题在于这对于findAll不起作用。Example 158. Basic repository interface to persist Person entities
public interface ReactivePersonRepository extends ReactiveSortingRepository<Person, String> { Flux<Person> findByFirstname(String firstname); Flux<Person> findByFirstname(Publisher<String> firstname); Flux<Person> findByFirstnameOrderByLastname(String firstname, Pageable pageable); Mono<Person> findByFirstnameAndLastname(String firstname, String lastname); Mono<Person> findFirstByLastname(String lastname); }
interface CustomerRepository : ReactiveCrudRepository<Customer, String> {
fun findAll(pageable: Pageable): Flux<Customer>
异常:
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property findAll found for type Customer!
Spring Data MongoDB是否以某种方式支持此功能?