728x90
// set gps
Pageable pageWithSort = PageRequest.of(offset, pageSize, Sort.by("createdAt"));
Pageable support "WithSort" method and properties. Quote Below
withSort
public PageRequest withSort(Sort.Direction direction,
String... properties)
Creates a new PageRequest with Sort.Direction and properties applied.
Parameters:
direction - must not be null.
properties - must not be null.
Returns:
a new PageRequest.
'Java' 카테고리의 다른 글
| Improved Java Logging with Mapped Diagnostic Context (MDC) (1) | 2024.09.12 |
|---|---|
| [Spring] ST_intersects method (1) | 2024.09.09 |
| What is the purpose of com.google.common.base.Verify when we have com.google.common.base.Preconditions? (0) | 2024.08.09 |
| Spring Batch - Chunk 지향 프로세싱(Mybatis) (0) | 2024.07.17 |
| Pattern and Matcher (0) | 2024.07.16 |