[Solved] JpaRepository Error: Paging query needs to have a Pageable parameter! Offending method public abstract

When practicing spring data JPA, use the paging interface pageable to query data. After the interface is implemented, run and report an error:

Paging query needs to have a Pageable parameter! Offending method public abstract

Implementation code summary:

import org.springframework.data.domain.Page;
import java.awt.print.Pageable
...
@Service
public class AyUserServiceImpl implements AyUserService {
    @Resource
        private AyUserRepository ayUserRepository;
    ...
    @Override
        public Page<AyUser> findAll(Pageable pageable){
            return ayUserRepository.findAll(pageable);
        }
}

Later, it was found that the package name of pageable was wrong and changed to

import org.springframework.data.domain.Pageable;

It works normally

Similar Posts: