Thanks for your feedback. We will consider the suggestion.
Studio generates CASCADE OnDelete policy for one-to-many relations by default. So when ‘Parent’ object is deleted, associated ‘Child’ objects is automatically deleted. This should prevent from the creation of dangling child records in the DB
The problem is that my objects are not coming in through the gui.
I have a custom api and in one of the classes I added children to the collection but forgot to set the parent relation. I use mapstruct for object mapping and have to implement an addX method on every parent that sets the inverse relation on it’s children. I forgot to do this for a couple of classes.
So the children could actually exist without a parent being present which doesn’t make sense in the composition model.