The Spring Data JPA findAll
method declared in PagingAndSortingRepository
interface and implemented in the SimpleJpaRepository
class takes Sort as input parameter and provides multiple sorting strategies to retrieve all the records of the entity type from the underlying database.
-
Sort(Direction direction, List<String> properties)
- and
- ascending
- Sort by(Direction direction, String... properties)
- Sort by(List orders)
- Sort by(Order... orders)
- Sort by(String... properties)
- Sort by(Direction direction, String... properties)
- Sort descending()
- Sort ascending()
- Order getOrderFor(String property)
- boolean isSorted
- boolean isUnsorted()
- Sort withDirection(Direction direction)