PageRequest constructors have been deprecated

前端 未结 3 1521
粉色の甜心
粉色の甜心 2020-12-08 09:30

I\'m working the Spring Data Commons v2+ snapshot, and I see that the constructors for a PageRequest have been deprecated. This appears to have occurred betwee

3条回答
  •  粉色の甜心
    2020-12-08 10:11

    It's just the constructors which have been deprecated. Instead of

    new PageRequest(firstResult, maxResults, new Sort(...))
    

    you can now use

    PageRequest.of(firstResult, maxResults, Sort.by(...))
    

    and that's it.

提交回复
热议问题