Hello. There are 2 tables. Product - Category. Connected via foreign key. Now the essence of the problem. As you understand, by category you can determine which products belong to it. But! There is a problem. Need the ability to delete products. But when deleted, it throws an exception that the object is bound to another object. Because of what you can not delete.
Many will come to mind cascade removal. But, as I understand it, during a cascade delete, all dependent records are deleted. And I need only one.
That is, remove the product, but the category remains.
Thanks in advance.