且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

多对多关系的属性(休眠)

更新时间:2022-02-12 09:42:22

据我所知,不可能这样映射,你必须切换到 One-To- 多对一关系,中间是你的 B.您的日期将是 B 的一个属性.

From what I know, it is not possible to map it this way, you have to switch to One-To-Many and a Many-To-One relationships, with your B in the middle. Your date will be an attribute of B.

由于缺乏进化性,Hibernate 文档建议一般避免多对多,并从一开始就使用这两种关系.

For this lack of evolutivity, the Hibernate documentation recommends to avoid the Many-To-Many in general, and use the two relationships from the beginning.