Hibernate Many-to-many association: left hand side collection contains elements, but right hand side collection is empty
I got a problem with a many to many association in my persistence layer. My scenario is the following: A user can has several roles and a role can have several user attached to it. During the tests I encountered a strange behavior. I created role object and several user objects. The role was set to each of the users. After this the users were saved using a DAO. Then one of the user gets loaded to check whether he got the role that was passed to him before saving the user object. Calling getRoles() on the user shows that the role was set correctly. To check whether the inverse direction also