In the course of this section, we will learn different techniques that can be used to sort query results with Spring Data JPA. We will also learn the guidelines that we can use to select a proper sorting method for each situation.
Creating a query method
Modifying an existing service method to use the new query method.
OrderBykeyword to the method name.
Append the property expression that corresponds to the property of the entity, which is used to sort the query results, to the method name.