我有一个带有嵌入式子对象的对象:
class Parent {
Child child
static embedded ['child']
}
class Child {
String name
}
我想使用executeQuery(因为在我的实际情况下,我不能使用Where查询或创建条件)。在不切换标准的情况下该怎么做?
请您参考如下方法:
尝试:
Parent.executeQuery("FROM Parent parent WHERE parent.child.name = 'FOO'")
编辑:
刚刚注意到,您需要为嵌入式对象添加静态声明:
static embedded ['child']
也许可以解决问题...




