GORM 中的复合外键列
我需要在 GORM 中自定义复合外键的列名称,但我没有找到任何说明如何执行此操作的文档。 我知道如何自定义PK列,以及如何自定义单列FK,但不知道如何自定义多列FK。 有可能吗?
谢谢。
I need to customize the column names for composite foreign keys in GORM, and I didn't find any document that shows how to do it. I know how to customize PK columns, and how to customize a single-column FK, but not multi-column FK. Is it possible at all?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
具有复合 id 的域类必须实现
Serialized
接口。A domain class with composite id must implement the
Serializable
interface.您需要在对象映射闭包中使用“id:composite”构造。
我必须去上班,所以这里是简短的:
Grails:对象关系映射
You need the "id: composite" construct in your object mapping closure.
I have to leave for work, so here it is in brief:
Grails: Object Relational Mapping