java - What could the reason of the exception 'org.hibernate.QueryException Message Not all named parameters have been set:' possibly be? -
so trying execute following query in grails
user user = springsecurityservice.currentuser def approvergrouplist = approvergroupservice.getapprovergroupsbyuser(user.id) return verificationrequest.executequery("select distinct v.fundtransfer verificationrequest v v.fundtransfer.creator.corporatehouse=:corporatehouse , v.verified = false , v.fundtransfer.status ='queued' , v.approvergroup in (:approvergrouplist)", [corporatehouse:corporatehouse],[approvergrouplist:approvergrouplist]) however getting following exception :
/fund-transfer/list-verification-requests class org.hibernate.queryexception message not named parameters have been set: [approvergrouplist] [select distinct v.fundtransfer verificationrequest v v.fundtransfer.creator.corporatehouse=:corporatehouse , v.verified = false , v.fundtransfer.status ='queued' , v.approvergroup in (:approvergrouplist)] also corporatehouse object that's passes method executing query , not null. reason?
p.s. new grails!
you've passed 2 maps executequery:
verificationrequest.executequery("...", [corporatehouse:corporatehouse],[approvergrouplist:approvergrouplist]) it should 1 map 2 values:
verificationrequest.executequery("...", [corporatehouse:corporatehouse, approvergrouplist:approvergrouplist]) according documentation second map taken map additional parameters.
Comments
Post a Comment