休眠 - 限制(日历,小时)

时间:2011-08-19 11:19:47

标签: hibernate hql restriction restrictions

我可以使用hibernate限制(我的意思是ids 130,146,147,148)从表中获取指定时间(例如 9am )创建的项目吗?

enter image description here

您能告诉我(Java中createDate格式为Calendar)吗?

1 个答案:

答案 0 :(得分:1)

是否必须使用限制条件完成?你不能用别的东西吗?如果是,那么你应该能够做到这样的事情:

Restrictions.sqlRestriction("DATEPART(hour,createDate) = 09")

不确定09年的0并没有自己测试,但不明白为什么它不起作用。