First of all, thanks so much for the book, it’s really helped my understand this complex topic.
My question is about whether I should use nullify or cascade for a certain “to-many” relationship I have. I have a page object which can optionally contain one image object. The image object can be contained in 1 or more pages at a time. I know that the image -> page delete rule should be nullify, as I wouldn’t want the page to be deleted if its image is deleted. For the page -> image delete rule, I’m not sure whether to use nullify or cascade. What I want to happen is that the image should be deleted when the page is deleted iff no other page is referencing the image (i.e. the count on the image -> page relationship goes to zero). Will the cascade rule check the relationship count and only delete the image if the count is zero? Or should I set the image->page delete rule to nullify and keep track of the number of referencing pages myself, and do the delete of the image manually when appropriate?
Thanks so much!