have the following entity.
1)entityToSave.anotherEntityID (foreign key to the other entity)
2)entityToSave.anotherEntity (obtained thru prefetchpath, representing the above anotherentityID)
3)entityToSave.otherEntityCollection (another collection of objects thru prefetchpath)
when i say adapter.save(entity, refetchAfterSave, recurse) what will happen in below cases
for 1, 2, 3 things.
refetchAfterSave recurse 1 2 3
true true
true false
false true
false false
To sum it up, Recurse = true, will recursively save all entities in the graph.
i.e. if the main saved entity had related entity objects associated with it, they will be saved into the database, in case they are dirty or new.
This doesn't include entities referenced in the database but not linked in the saved graph.
refetchAfterSave = true, will refetch each and every entity saved in the graph.
(Main entity only in case of recurse = false, every other saved entity, in case of recurse = true)
when i change anotherEntityID, with the refetchAfterSave(true) and recurse(true) would save fetch me with the new anotherEntity.
No entity would be fetched unless it was already in the graph.
what am most interested is when will the saveEntity will get me the entityToSave with all its prefecth paths. I want this within the save method.
No, you will have to call a fetch method.
In other words, you will have to fetch the graph. Use PrefetchPaths to fetch related entities.