grails 中是否有 ElementCollection/CollectionOfElements 的替代方案
grails 中是否有 ElementCollection/CollectionOfElements 的替代方案?
我需要为一组组件/可嵌入对象创建映射。
例如,一个人有一组地址,其中 Address 是可嵌入对象。
@Embeddable
class Address{
...
}
class Person{
Set <Address> addresses
}
谢谢
Is there an alternative to ElementCollection/CollectionOfElements in grails.
I need to create a mapping for a set of Components/Embeddable Objects.
For example A person has a set of addresses where Address is a embeddable object.
@Embeddable
class Address{
...
}
class Person{
Set <Address> addresses
}
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你想要的是构图。
http://grails.org/doc/latest/guide/5.%20Object%20Relational%20Mapping%20(GORM).html#5.2.2%20Composition%20in%20GORM
What you want is composition.
http://grails.org/doc/latest/guide/5.%20Object%20Relational%20Mapping%20(GORM).html#5.2.2%20Composition%20in%20GORM