且构网

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

属性上的许多一对多的关系(休眠)

更新时间:2021-08-21 09:21:11

据我所知,这是的无法以这种方式映射它,你必须为切换到一对 - 许多和许多一对一的关系,在中间的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.


有关这种缺乏evolutivity的,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.