I try to make an application with Spring-Data-JPA on a table in order by ASC but it gives me an error:
Invalid derived query! No property asc found for type java.util.Calendar
Why ?
List<Foo> findAllOrderByDateAsc();
or
@Query("SELECT * FROM foo ORDER BY date ASC") List<Foo> findAllOrderByDateAsc();
Advertisement
Answer
Try to add “By” between “All” and “Order” like this:
List<Foo> findAllByOrderByDateAsc();