The documentation says:
If the association is bidirectional, one side has to be the owner and one side has to be the inverse end (ie. it will be ignored when updating the relationship values in the association table):
So, the side which has the mappedBy
attribute is the inverse side. The side which doesn’t have the mappedBy
attribute is the owner.
The owner side is the side which Hibernate looks at to know which association exists. So, for example, if you add a Foo in the set of foos of a Bar, a new row will be inserted by Hibernate in the join table. If, on the contrary, you add a Bar to the set of bars of a Foo, nothing will be modified in the database.