0
我有一个人实体,并在其中的人的两个列表,我以这种方式实现(感谢这个帖子:Hibernate many-to-many association with the same entity):映射列表
@ManyToMany
@JoinTable(name="tbl_friends",
[email protected](name="personId"),
[email protected](name="friendId")
)
private List<User> friends;
@ManyToMany
@JoinTable(name="tbl_friends",
[email protected](name="friendId"),
[email protected](name="personId")
)
private List<User> friendOf;
但是,随着@ManyToMany注释级联(MERGE,DELETE等)不起作用。 有没有办法实现相同的映射,但启用级联?