中如何使用「分組方式,」用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