Spring Specification and Pageable

后端 未结 1 1306
故里飘歌
故里飘歌 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<PersonelEntity> filteredData (Specification<PersonelEntity> spec, Pageable pageable){
        Page<PersonelEntity> pageData = personelRepository.findAll(spec,pageable);
        List<PersonelEntity> filteredData = pageData.getContent();
        return filteredData;
    }
    
    0 讨论(0)
提交回复
热议问题