我的问题应该很明显,但我现在看不到光明:-(
我有两个这样的域类:
class Parent {
String name
static hasMany = [children: Child]
}
class Child {
String name
}
现在我应该能够通过使用 Parent 的动态查找器来找到孩子的父母,例如:
Parent.findByChildren([someChild] as Set)
但是我收到一个休眠错误,指出我的休眠 SQL 中有语法错误:
Caused by: java.sql.SQLException: No value specified for parameter 1
供参考: someChild 是一个具体实例。而且我想避免 Child 在定义中有明确的父母。
那我怎么能从孩子到父母呢?
此致,
克里斯蒂安·索内·詹森