在 JPA 2.0 中实现三向联接关系
我正在尝试在 JPA 2.0 中实现三向连接关系(使用注释)。
我的域名如下:
我查看了 @JoinTable
注释,我不知道如何使用它是为了实现这种关系。
有人可以提供线索或代码示例吗?
I am trying to implement a three-way join relationship in JPA 2.0 (using annotations).
My domain is as follows:
I had a look at the @JoinTable
annotation and I am not sure how to use it in order to implement the relationship.
Can anyone please provide clues or code samples?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我很好地理解你的问题,你实际上有另一个
Entity
,我们称之为AdvertisementAssignment
。然后,该实体应该与每个 3 向对应实体具有OneToOne
关联。If I understand your question well, you actually have another
Entity
, let's call itAdvertisementAssignment
. Then, this entity should haveOneToOne
association with each of your 3-way counterparts.