@ManyToMany(mappedBy = “foo”)
2022-09-01 03:54:06
Foo有:
@ManyToMany(mappedBy = "foos")
private Set<Bar> bars
和酒吧有:
@ManyToMany
private Set<Foo> foos
mappedBy 属性的位置对双向关系有什么区别,除了表是称为foo_bar还是bar_foo;如果没有mappedBy属性,我得到两个联接表,分别foo_bar和bar_foo。