I need help with Hibernate and many-to-many relationship. Here is my sample schema on this link. It's simple enough so you can easily get the point. Concentration is on tables PERSON
, ADDRESS
and PERSON_ADDRESS
.
Java model is here on this link. My questions are:
- Is it totally wrong to have that class
PersonAddress
? - If I leave it like that what are the problems I could encounter with, at some later stage of development?
- How can I optimize it?
Git repo with my sample code is here.