I have a problem with a table that gets an insert that I don't want. There are 3 tables: Users, Newsletters and a join Users_has_Newsletters. The Newsletters table has already some values. On my registration form I get the values from the Newsletters table to create an option list.
When a user registers I save everything to my DB. I've defined a many to many mapping in my Users hbm file.
Every time I save my data, I also insert the newsletters they've selected into the Newsletters table, but I don't want that to happen. I only want my Users and Users_has_Newsletters tables to get inserted with the values.
Is it possible to do this? Is using a many to many mapping the correct thing to do?
Regards, Heino.
|