我正在嘗試使用動態查找器搜索status
和OpenOn(date)
兩個字段。此查詢工作狀態良好,罰款:在grails中使用動態查找器搜索值
render(view:'list', model:[incidentInstanceList:Incident.findAllByStatusIlikeAndOpenOnGreaterThan("closed",new Date()-1,[sort:"id",order:"desc"])])
但現在我想通過三個字段,即UserId
,status
和OpenOn(date)
與動態查找器來搜索:
render(view:'list', model:[incidentInstanceList:Incident.findAllByStatusIlikeuserIdIlikeAndOpenOnGreaterThan("closed","${session.user.userId}",new Date()-1,[sort:"id",order:"desc"])])
此查詢不正常工作並顯示一個錯誤:
No signature of method: app.Incident.findAllByStatusIlikeuserIdIlikeAndOpenOnGreaterThan() is applicable for argument types: (java.lang.String, org.codehaus.groovy.runtime.GStringImpl, java.util.Date, java.util.LinkedHashMap) values: [closed, tt10004, Wed Aug 24 15:12:21 IST 2011, [sort:id, order:desc]] Possible solutions: findAllByStatusIlikeuserIdIlikeAndCreatedOnGreaterThan(java.util.List)
請指導我解決這個問題。
謝謝回覆 – manu