Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

jpa page sort

Pageable sortedByName = PageRequest.of(0, 3, Sort.by("name")); 
Pageable sortedByPriceDesc = PageRequest.of(0, 3, Sort.by("price").descending()); 
Pageable sortedByPriceDescNameAsc = PageRequest.of(0, 5, Sort.by("price").descending().and(Sort.by("name")));
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #jpa #page #sort
ADD COMMENT
Topic
Name
9+4 =