Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ManyToMany deletion issue

 
Luke Shannon
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello;

I have an Entity called Audit with a member called Materials which is a collection of Material Entities:



In Material I have:



The table that is created is:



This what I would expect. However the issue I have is I can't delete an Audit without getting a 'Cannot delete or update a parent row: a foreign key constraint fails' exception on this table.

I have been reading through the Annotations reference guide and I am still not sure how to map this so I can delete Audits and have the Materials persist but the material_audit mappings removed. Its actually not even important for me to ever list all the Audits for a material, (I only want to show an Audit and its associated Materials) so I may not need the Audits member in Materials (if that helps at all).

Any tips would be great.

Thanks,
Luke
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic