I’m new to JPA and studying. When I have Many-to-Many relationship b/w tables in SQL for example Author and Book: I used a join table AuthorBook with composite primary key.
How should do it in JPA: Should I make only two entities Author and Book and create relationship ManyToMany with mappingBy one of them (in Author for example) and make another own owner of relationship: in Books (with using joinColumns).
Or should I also make a "join" 3rd entity AuthorsBooks with JPA?
What way is correct? Are there actually different ways or an only way a preferable way?
Besides my specific question, I wonder if somebody know a good example/tutorial on this question? (I couldn't find a good one) Thanks!