proposal: a master's delete and the composition children it owns - #66
Open
delchev wants to merge 1 commit into
Open
proposal: a master's delete and the composition children it owns#66delchev wants to merge 1 commit into
delchev wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
composition: truedeclares ownership - the child is a detail of its master with a NOT NULL key because it cannot exist without it - and nothing in the model says what a delete of the master does to those children. The observed answer is: nothing. The rows stay, pointing at a key that no longer exists, and while no surface renders them (a detail is reached through its master's page) every report, roll-up and aggregate over the child keeps counting them:Proposal
0033:whenMasterDeleted: cascade | refuseon the composition relation, defaultcascade.cascadedeletes each child as a deletion in full - its own children with it, its deletion observed by the reactions bound to it, all of it one atomic unit with the master's own.refuserejects the master's delete while any child exists, naming both entities.The behaviour is not conditional on the key:
cascadeis what a conforming generator does for every composition, authored or not, because it is what composition means. The key exists to chooserefuse- and neither outcome may be limited to deletes arriving over a public interface, since a reaction or a further cascade reaches the same rows.Implementation: eclipse-dirigible/dirigible#7111 (issue eclipse-dirigible/dirigible#7100).