Please help me, I think there is something that I am not doing correct.
I have User
and Contact
, that are in Many-to-Many
relation.
In the XML mapping Contact, the mapping of userSet is completely wrong:
It should be:
It looks to me like you copy-and-pasted this from User and then didn't update it.
Why are you using XML rather than annotations? XML is much more error-prone, as you can see. In addition, a lot of these settings should be defaulted correctly by Hibernate. If you had just left out some of these attributes, it probably would have worked fine.