我创建了一个函数来获取一些与 Date 匹配的行。但该功能未相应地执行。我怀疑有一些语法问题。请帮我找到问题。道具功能如下:public List<ReportSewing> getReport(Date reportDate) {
return session.getCurrentSession()
.createQuery("from ReportSewing where DATE(reportDate) = (reportDate)")
.list();
}
1 回答
蝴蝶刀刀
TA贡献1801条经验 获得超8个赞
似乎您忘记传递查询参数。
public List<ReportSewing> getReport(Date reportDate) {
return session.getCurrentSession()
.createQuery("from ReportSewing where DATE(reportDate) = :reportDate")
.setParameter("reportDate", reportDate)
.list();
}添加回答
举报
0/150
提交
取消
