grails - Parameter #1 is not set error -
i got error grails query. had class user:
class user { string username string passwordhash static hasmany = [roles: role, permissions: string, clients: user, owners: user] } when query:
def addclient() { def principal = securityutils.subject?.principal user currentuser = user.findbyusername(principal); if (request.method == 'get') { user user = new user() [client: currentuser, clientcount: user.countbyowners(currentuser)] } } grails that:
parameter "#1" not set; sql statement: select count(*) y0_ user this_ this_.id=? [90012-164]
why?
looks currentuser null.
btw, wonder, why count owners, specify user owners? according hasmany definition, owners collection.
Comments
Post a Comment