Many to many to many: how to?

I would recommend you use @Embeddable instead for the id as I have shown here: How to join more tables to the same id (FK)? - #2 by beikov