我想知道是否可以在休眠条件中查询指定小时数的表。例如我有 mysql 查询
SELECT * FROM eventlog WHERE HOUR(CREATED_AT) BETWEEN 8 AND 16
AND CREATED_AT BETWEEN '2013-01-01 11:00:00' AND '2013-01-08 11:00:00'
我想在标准中转换:
criteria.add(Property.forName("HOUR(created_at)").between(8, 16));
criteria.add(Property.forName("created_at").between('2013-01-01 11:00:00', '2013-01-08 11:00:00'));
它一定很简单,但我真的很喜欢这个。
我将不胜感激任何帮助。谢谢