Spring Specification and Pageable

后端 未结 1 1313
故里飘歌
故里飘歌 2021-01-04 13:20

How can I use Specification and Pageable together?

personelRepository.java

@Query(\"SELECT e FROM Personel         


        
1条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 13:50

    Solve by editing personelService.java and delete findData function on personelRepository. I use springframework.data.jpa.repository.JpaRepository findAll() function and it works.

    public List filteredData (Specification spec, Pageable pageable){
        Page pageData = personelRepository.findAll(spec,pageable);
        List filteredData = pageData.getContent();
        return filteredData;
    }
    

    0 讨论(0)
提交回复
热议问题