Hi everyone!, I'm developing my first application using hibernate and I'm having an error while I'm mapping a many to many relation. I've tried several times to fix it but I haven't been able to do it so I decided to ask you.
Basically the relation is this: A Group is made of many Users and a User can be part of many Groups.
Please if anyone could tell me something it would be very useful since I have no experience with this framework. I know this post could be pretty long but I'm desperate to fix this.
Thanks in advance to everyone!
Here I give you the User class:
Here's the User hbm:
Here's the group class:
Here's the Group hbm:
Here's the code where I'm relating the user with the group:
If you know that the values inserted in the JOIN table are not violating the constraints in MANY-MANY entity tables all I can suggest is(are) Junit(s).
or try inserting that row(s) using SQL in DEV DB.
Santosh I've solved the problem it was a mistake in the hbm's mappings. Many thanks for all your help! Now my laptop doesn't have internet connection since I'm at work but if you want I'll post the changes in the mappings when I get home.