如何比较 Maven 应用程序中的两个日期 java
How to compare two date in a maven application java
我创建了一个函数来获取一些与日期匹配的行。但是该功能没有相应地执行。我怀疑存在一些语法问题。请帮我找到问题所在。
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();
}
我创建了一个函数来获取一些与日期匹配的行。但是该功能没有相应地执行。我怀疑存在一些语法问题。请帮我找到问题所在。 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();
}