What is the correct way to define many-to-many relationships in NHibernate to allow deletes but avoiding duplicate records
问题 I've been fighting with an NHibernate set-up for a few days now and just can't figure out the correct way to set out my mapping so it works like I'd expect it to. There's a bit of code to go through before I get to the problems, so apologies in advance for the extra reading. The setup is pretty simple at the moment, with just these tables: Category CategoryId Name Item ItemId Name ItemCategory ItemId CategoryId An item can be in many categories and each category can have many items (simple