Reputation: 33605
i just want to know the difference between using @ManyToMany relationship wit @JoinColumn and using it without @JoinColumn
Upvotes: 0
Views: 266
Reputation: 691635
A many-to-many association always needs a join table. A join column is not sufficient: it only enables a one-to-many association.
If you don't specify any @JoinTable
annotation on the association, then default values will be used. Hibernate wil use a join table with a default name and default columns composed from the names and IDs of the associated entities.
Upvotes: 3