【发布时间】:2010-05-19 11:10:46
【问题描述】:
我需要编写一个查询来获取一个时间范围内的对象,目前查询如下所示:
Timestamp from = ...
Timestamp to = ...
getHibernateTemplate().find("from " + Person.class.getName() + " ml where ml.lastModifiedOn>="+from.toString()+" and m1.lastModifiedOn<=" + to.toString());
但是,由于显而易见的原因,这不起作用。如何格式化时间戳以使查询可以接受。
org.springframework.orm.hibernate3.HibernateQueryException:意外令牌:第 1 行第 123 列附近的 16 [来自 Person ml where ml.lastModifiedOn>=2010-02-12 16:00:21.292 和 m1.lastModifiedOn【问题讨论】:
标签: java hibernate timestamp hql