MappedBy in bi-directional @ManyToMany : what is the reason
问题 What is the reason for setting MappedBy in bidirectional many-to-many relationships? When one table has significant amount of records, while other has a few, which side is better to put mappedBy? 回答1: It's actually a good question, and it helps to understand the concept of an "owning" entity. If you want to prevent both sides (in a bidirectional relationship) from having join tables , a good idea, then you need to have a mappedBy= element on one side. Whether or not there is a join table is