Two entities within Many to many relationships are associated with a junk table. There is no side that must be an owner side or inverse side, meaning that any sider can be an owner side.
@JoinTable defines an owner side; MappedBy defines the inverse side. By this way, both entities are acknowledged to be associated in a many-to-many relationship.
Owner side:
Inverse side:
And it generates a junk table in the database
No comments:
Post a Comment