的领域查询我有Parent
阶级,两条Child1
和Child2
继承它:GORM分离通过继承
class Parent { }
class Child1 extends Parent {
String prop1
}
class Child2 extends Parent {
String prop2
}
现在我需要写选择所有家长clases,但对prop1
和prop2
标准,即像这样的东西
DetachedCriteria crit = Parent.where {
(prop1 == 'Some value') || (prop2 == 'Some value')
}
crit.list()
我该怎么做?
嘿,现在这是一个好主意! –