我有以下型号:
TestProfessional {
static hasMany = [answers: Answer]
}
Answer {
String answer;
}
如何找到具有指定ID的答案的TestProfessional?
答案 0 :(得分:0)
有效:
def questions = TestProfessional.withCriteria(uniqueResult: false) {
answers {
inList("id", answersIds)
}}