• Post Reply Bookmark Topic Watch Topic
  • New Topic

ManyToMany deletion issue  RSS feed

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

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.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!