AE
Size: a a a
AE
s
@Repository
public interface CustomerRepository extends PagingAndSortingRepository<Customer, Long> {
Page<Customer> findPaginated(int pageNo, int pageSize);
}
SERVICE:
public Page<Customer> findPaginated(int pageNo, int pageSize) {
org.springframework.data.domain.Pageable pageable = PageRequest.of(pageNo - 1, pageSize);
return this.customerRepository.findAll(pageable);
}
Ошибка
:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerService': Unsatisfied dependency expressed through field 'customerRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in com.combainer.arm.repository.contact.CustomerRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.
Caused
by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRepository' defined in com.combainer.arm.repository.contact.CustomerRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.domain.Page com.combainer.arm.repository.contact.CustomerRepository.findALl()
SZ
SZ
AE
Page<Customer> findPaginated(Pageable pageable)
N
AE
@JsonProperty
N
V
А
А
IV
IV
А
А
V
D
ch