Tim Holloway wrote:Actually, I think you can define a join table with extra fields in it.
What I fiound frustrating about doing many-many in JPA was that - and memory is fuzzy here - JPA was favoring working with a join table that it automatically named itself, as well as naming the join fields and the names didn't fit the standards of the legacy database. So I had to learn how to explicitly set all that up.
Incidentally, SQL may not be the best approach in cases where the relationships between entities are more important that the attributes of the entities. For cases like that, a graph database like Neo4J might be preferable.