This content has been marked as final. Show 1 reply
bi-directional mappings are a bit tricky: you always have to update BOTH sides of the mapping.
So, if you want to map a Skill to an User, this will NOT work:
user.getSkills().add ( mySkill); entityManager.merge(user);
You will have to do something like this:
myUser.getSkills().add ( mySkill); mySkill.getUsers().add (myUser); entityManager.merge(myUser);
Hope this helps