I use Fluent and NHibernate. I have two objects: A and B, which have a many-to-many relationship between them. I use many-to-many unidirectional mapping when A HasMany B's. There is no reference to A in B (unidirectional).
This creates a third table (named ABMapping) in the database, which has two columns related to primary keys A and B.
If I delete object A, the records from the ABMapping table associated with A will be deleted. That's cool.
But now I can not delete object B, because it has an FK constraint. How can I configure it so that when you delete B, all entries related to B in ABMapping are automatically deleted?
Zuber source
share