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