Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Hibernate 3.0.5
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I will post more info if necessary... I've currently migrated from Hibernate2 to Hibernate3.
In a many-to-many relationship where 2 users share the same role and one of the user is deleted the role should stay 'cause it's still associated with another user.
It works fine with Hibernate2, no problem at all. But since we've been running Hibernate3 all the intermediate rows gets deleted???!!!
The difference is the query Hibernate uses.
Hibernate2: DELETE FROM user_roles WHERE role_id = AND user_id = ?
Hibernate3: DELETE FROM user_roles WHERE role_id = ?
The only thing that is changed from Hibernate2 to Hibernate3 is that we use a SqlServerUserType for our id's instead of regular strings. Otherwise EVERYTHING is exactly the same...
Why is Hibernate3 using another query?
Kind regards, Andreas Eriksson