我有以下内容:
def userInstance=User.findAll("from User u where u.merchant is not null and u.merchant.id = ? and u.authorities.authority.contains('ROLE_MERCHANT')", merchantId)
并得到以下错误:
org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 121 [from com.testing.tests.User u where u.merchant is not null and u.merchant.id = ? and u.authorities.authority.contains('ROLE_MERCHANT')]
at $Proxy20.createQuery(Unknown Source)
at testing.admin.UserService.findByMerchantId(UserService.groovy:14)
如何仅返回具有特定角色的用户?
谢谢