我有以下带有Criteria结构的Grails:
allInfo = Scholarship.withCriteria {
between('gpa', '0', gpa)
grades {
idEq year
}
scholarshipCounties {
eq('county.id', county)
}
majors {
idEq major
}
activities {
idEq activity
}
eq('specialTypeInd', special)
}
我希望这能退还(gpa和成绩和专业)或奖学金县或活动或特殊类型Ind的奖学金。
您应该使用各自的or{}
和and{}
子句:
allInfo = Scholarship.withCriteria {
and{
between('gpa', '0', gpa)
grades {
idEq year
}
majors {
idEq major
}
}
or{
scholarshipCounties {
eq('county.id', county)
}
activities {
idEq activity
}
eq('specialTypeInd', special)
}
}