【发布时间】:2015-06-29 09:58:21
【问题描述】:
String query = "select t.id from TheEntity t where t.registrationDate > :start and t.registrationDate > :end";
鉴于简单的查询,我绑定了以下参数:
q.setParameter("start", startDate);
q.setParameter("end", endDate);
startDate 和 endDate 都是 java.util.Date。当我在运行时将参数绑定到查询时记录它们时,它会记录时间戳。
问题,它没有返回任何结果,甚至认为sql返回数据。我究竟做错了什么?我应该只使用字符串吗?
Hibernate 是底层实现。
【问题讨论】:
标签: sql-server hibernate jpql