我创建一个函数来获取一些与日期匹配的行。但是该功能未相应执行。我怀疑存在语法问题。请帮助我找到问题。DaoImpl函数如下所示:
public List<ReportSewing> getReport(Date reportDate) {
return session.getCurrentSession()
.createQuery("from ReportSewing where DATE(reportDate) = (reportDate)")
.list();
}
好像您忘了传递查询参数。
public List<ReportSewing> getReport(Date reportDate) {
return session.getCurrentSession()
.createQuery("from ReportSewing where DATE(reportDate) = :reportDate")
.setParameter("reportDate", reportDate)
.list();
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句