Given these entities :
I want to link users and groups but only from the same domain.
I also want a user to be in one group only.
The only way with composite keys is to make One-To-Many, Unidirectional with Join Table but I can't put unique=true in the @JoinColumn of my inverseJoinColumns because it will generate a unique index for each field and not one composite. I also can't use @UniqueConstraint as it is not supported in @JoinTable.