Order By Date ASC with Spring Data Order By Date ASC with Spring Data java java

Order By Date ASC with Spring Data


Try to add "By" between "All" and "Order" like this:

List<Foo> findAllByOrderByDateAsc();


I don't think you can use findAll as a prefix.

Regarding the query, select * is not valid JPQL. It should be

select foo from Foo foo order by foo.date desc


date is reserved word in SQL. Try changing the table property to foo_date, for example and rewrite your query as SELECT * FROM foo ORDER BY foo_date DESC