1
I have problems with the updates of my entity Mdfe, before explaining what happens, I would like you to look at the image below, from it I can explain better.
We can verify that The Mdfe has a one-to-many relationship with Mdfedocumento, which also has a one-to-many relationship with Mdfeunidadetransport and this has a one-to-many relationship with Mdfeunidadecargo.
The CRUD of this structure is realized all over the Mdfe. When editing a document and updating the entity, the document is changed, however, from there, the other entities do not suffer the changes. For example: If when editing a Mdfe and changing the transport unit of a particular document, when updating the entity Mdfe, the transport unit does not undergo the change made.
How can I get these inserts/changes to be made only by saving Mdfe? If it is not possible to insert/update only the parent entity, which is the best way to insert/update the others?
Thank you all, and if you have any doubts in my explanation comment that I am improving.