How to use projection interfaces with pagination in Spring Data JPA?

后端 未结 6 2115
-上瘾入骨i
-上瘾入骨i 2021-02-19 10:50

I\'m trying to get a page of a partial entity (NetworkSimple) using the new feature of spring data, projections

I\'ve checked the documentation and if I request only:

6条回答
  •  无人及你
    2021-02-19 11:32

    You can use:

    @Query("SELECT n FROM Network n")
    Page findAllProjectedBy(Pageable pageable);
    

提交回复
热议问题