Hi!
I have defined a many to many relationship between two classes. Event and Person (defined in a separate database table person_event). Now, suppose I want to delete a person, so all its related associations with events must also get deleted from the person_event table. In other words, I want cascade ON DELETE.
Lets consider a scenario. - The "events" table contains three events identified by id=1, 2, 3. - The "person" table contains two persons identified by id=4, 5. - The "person_event' table containing associations like 1-4, 2-4, 3-5
Now, suppose I delete event 1 using Hibernate.delete(), then not only does it delete event1, and association person_event1-4, but also the person4!
The problem is person4 is referenced by another tables and it throws an Foreign Constraint Exception... How I could configure NHibernate to delete just the Event and associations person_event?
Thanks in advance