中如何使用“分组方式,”用Grails的标准如果我有三个域类是这样的:三个表
class Candidate {
static belongsto=[application:Application]
}
class Vote {
String name;
static belongsto=[application:Application]
}
class Application {
Date datedemand;
Candidate candidates;
Vote votes
static hasMany = [candidates:Candidate,votes:Vote]
}
我想要检索通过投票的名称分组的所有候选人。
我开始下面的尝试,我仍然受阻:
def criteria = Application.createCriteria()
def results = criteria.list {
votes {
}
candidates{
}
}
[see here](http://stackoverflow.com/questions/5598436/grails-createcriteria-group-by) – havenchyk 2013-04-27 10:32:21
谢谢。但是,这没有用。 – 2013-04-27 11:17:29