Relative Content

Tag Archive for typeormcascade

Is there a way to use both insert and update in cascade option of typeorm with Domain Driven Design?

In one of my project I am using Domain Driven Desing. with this I have an aggregate which governs inserting its child elements and updating them, so i have one to many relationship between the parent and the child entities. the one side being the aggregate root. so when I try to insert a child entity in the childs collection, type orm expect the updated values for already existing child element (throws an exception saying update values are not defined,since I have set both update,insert in cascade in parent entity), but the intent only to insert the new child element, the cascade : update should be there , because there are other use cases where I need to update child elements through the aggregate root.