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

后端 未结 6 2131
-上瘾入骨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:18

    I think you need create findAllProjectedBy() as specification.Then you can use findAll() method like this.

    example :findAll(findAllProjectedBy(),pageable)

    Following link may be help to find how to create specification in spring.

    https://spring.io/blog/2011/04/26/advanced-spring-data-jpa-specifications-and-querydsl/

提交回复
热议问题