Same question here, but it didn\'t help me
I\'ve got thr
I got it working. My code was messy and I cleaned it out and it helped. I am not so sure why updating the groups-table inserts a new user to Users-table, but it is ok to me. At first I updated groups-table and inserted user to users-table and I always got an exception that there is the pk already (username is the pk). So it made two inserts to users-table, but now it's working perfectly. No more lines to groups-table just to joint-table and users-table.
// Add current new user to the customer-group
usersCollection.add(currentUser);
customerGroup.setUsersCollection(usersCollection);
// Updating the group using GroupsController, THIS INSERTS USER TO USERS-table as well!!
groupsC.updateGroup(customerGroup);