Jugen opened a new pull request, #614:
URL: https://github.com/apache/cayenne/pull/614

   When deleting an ObjEntity with flattened attributes Cayenne deletes the 
related DB attribute's row as well.
    
   So if we have for example an ObjEntity "FlatPainting" with flattened 
attribute "galleryName". If we then delete a "FlatPainting" then the associated 
gallery will also be deleted, leaving all other paintings at that gallery 
without a valid Gallery link.
    
   Furthermore if we add to our "FlatPainting" a "gallery" relationship 
attribute with delete rule Deny, the gallery was still being deleted.
   
   The original intention was for something like a "PaintingFull" ObjEntity 
having all painting attributes and a flattened attribute to "PaintingInfo" as 
well, where the relationship is 1:1. In this case it makes sense that deleting 
a "PaintingFull" should also delete its associated PaintingInfo record.
   
   In this PR a check has been added so that reverse toMany relationships are 
protected from deletion,
   and if a relevant ObjRelationship is present then deletions are deferred to 
it instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cayenne.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to