我遇到了从这个闭包中获得所需结果的问题
def authors{
results = Message.createCriteria().list {
projections {
author{
groupProperty('id', 'authorId') // 2nd param is alias
property('username', 'username')
}
}
and{
...
...
}
}
[authors:results]
}
Run Code Online (Sandbox Code Playgroud)
我想在我的gsp页面上显示这个列表,并希望使用别名访问这些值(而上面的条件是返回一个数组列表)