How to use OrderBy with findAll in Spring Data

前端 未结 7 1013
无人共我
无人共我 2020-12-02 04:25

I am using spring data and my DAO looks like

public interface StudentDAO extends JpaRepository {
    public findAllOrderByIdAsc         


        
7条回答
  •  春和景丽
    2020-12-02 04:29

    Please have a look at the Spring Data JPA - Reference Documentation, section 5.3. Query Methods, especially at section 5.3.2. Query Creation, in "Table 3. Supported keywords inside method names" (links as of 2019-05-03).

    I think it has exactly what you need and same query as you stated should work...

提交回复
热议问题