按Spring Data的按日期排序ASC [英] Order By Date ASC with Spring Data

查看:260
本文介绍了按Spring Data的按日期排序ASC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过ASC在表上使用Spring-Data-JPA创建应用程序,但这给了我一个错误:

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

为什么?

List<Foo> findAllOrderByDateAsc();

@Query("SELECT * FROM foo ORDER BY date ASC")
List<Foo> findAllOrderByDateAsc();


推荐答案

尝试在全部和之间添加按像这样的订单:

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

List<Foo> findAllByOrderByDateAsc();

这篇关于按Spring Data的按日期排序ASC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆