Grails:主域字段按详细域字段 [hasMany]
有域:
class Order {
static hasMany = [execDepartments: Department]
String orderNo
//boolean signature
...
}
class Department {
String name
...
}
我想为订单添加布尔签名字段,但按部门添加,因此我需要 execDepartments 为订单添加字段签名。是否可以?请帮忙。
There are domains:
class Order {
static hasMany = [execDepartments: Department]
String orderNo
//boolean signature
...
}
class Department {
String name
...
}
I want to add boolean signature field for Order but by Department, so I need field signature by execDepartments for Order. Is it possible? Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是m:m 关系吗?
为什么不创建另一个域,比如
然后你可以写belongTo
Is this an m:m relationship?
why not create another domain like
Then you can write the belongTo
您需要的是
Order
域中的签名列表。可能是一个将签名映射到订单的
OrderSignature
域。What you need is a list of signatures in the
Order
domain.Possibly an
OrderSignature
domain that maps signatures to orders.