[Voyage] Saving *ToMany references and dirty flag

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Voyage] Saving *ToMany references and dirty flag

Esteban A. Maringolo
How do you deal with the saving (and thus deleting/update) of
dependant collections of a root (#isVoyageRoot) object?

Could it be done as a two pass save?
It is... to save first the object (like basicSave:id: now) and then
walk through all its VOMongoToManyDescription's to save them
(#basicSaveDependants).

Which leads to another issue, how do you know when an object is dirty
and needs to be saved?

Because if we do what I proposed above it doesn't seem to be a good
decision to save all referenced items everytime the root is saved.

I have a strong ORM-shaped mind, and it's hard to break that, but is
hard for me to have everything as part of a big document (BSON
document), particularly almost all my objects are roots.

Regards!

Esteban A. Maringolo