In this example, the ProductService has a method findAll() which fetches all Product records sorted by name in ascending order or descending order. The ProductService uses this repository method to get the sorted list, and the ProductRest exposes this functionality via a REST endpoint.
Source code : https://gitlab.com/javabootprogrammer...
GET http://localhost:8080//product/sorted
#component #annotations #stereotype #springboot #repository #jpa #JPAannotations #springboot #springframework