I'm having problems with the updates of my MDFe entity, before explaining what happens, I would like you to look at the image below, from it I can explain better.
We can verify that MDFe has a one-to-many relationship with MDF and Document whose it also has a one-to-many relationship with MDF and TransportUnit and it has a one to many relationship with MDF and LoadUp.
The CRUD of this structure is done all over the MDFe. When editing an mdfe and updating the entity, the mdfeDocument is changed, but from there, the other entities do not undergo changes. For example: When editing an MDFe and changing the transport unit of a given document, when the update is performed on the MDFe entity, the transport unit does not change.
How can I make these inserts / changes only be done by saving the MDFe? If it is not possible to insert / update only the parent entity, what is the best way to insert / update the others?
Thanks to all, and if you have any questions in my explanation, comment on what I'm getting better at.