Java 异常的原因可能是什么';org.hibernate.QueryException消息未设置所有命名参数:';可能是吧?

Java 异常的原因可能是什么';org.hibernate.QueryException消息未设置所有命名参数:';可能是吧?,java,hibernate,grails,Java,Hibernate,Grails,因此,我尝试在grails中执行以下查询 User user = springSecurityService.currentUser def approverGroupList = approverGroupService.getApproverGroupsByUser(user.id) return VerificationRequest.executeQuery("select distinct v.fundTransfer from VerificationRequest v where

因此,我尝试在grails中执行以下查询

User user = springSecurityService.currentUser
def approverGroupList = approverGroupService.getApproverGroupsByUser(user.id)
return VerificationRequest.executeQuery("select distinct v.fundTransfer from VerificationRequest v where v.fundTransfer.creator.corporateHouse=:corporateHouse and v.verified = false and v.fundTransfer.status ='QUEUED' and v.approverGroup in (:approverGroupList)", [corporateHouse:corporateHouse],[approverGroupList:approverGroupList])
但是,我得到以下例外情况:

/fund-transfer/list-verification-requests
Class
    org.hibernate.QueryException
Message
    Not all named parameters have been set: [approverGroupList] [select distinct v.fundTransfer from VerificationRequest v where v.fundTransfer.creator.corporateHouse=:corporateHouse and v.verified = false and v.fundTransfer.status ='QUEUED' and v.approverGroup in (:approverGroupList)]
此外,corporateHouse是一个传递给执行此查询的方法的对象,其值不为null。 原因可能是什么


另外,我对grails是新手

这意味着您尚未设置查询中的所有参数。您遗漏了一些检查您的查询执行代码

参数应该在一个映射中,如下所示:

[corporateHouse:corporateHouse, approverGroupList:approverGroupList]

您已将两个映射传递到
executeQuery

VerificationRequest.executeQuery("...", [corporateHouse:corporateHouse],[approverGroupList:approverGroupList])
它应该是一个具有两个值的贴图:

VerificationRequest.executeQuery("...", [corporateHouse:corporateHouse, approverGroupList:approverGroupList])

根据第二张地图,它被视为带有附加参数的地图。

让我猜猜:没有设置所有参数?你能指出哪里吗?老实说,我看不出有什么错误!当然,我对grails是完全陌生的!