我創建了一個函數來獲取一些與 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
提交
取消