SaveMulti(recursive=true)

Posts   
 
    
swegele
User
Posts: 33
Joined: 25-Jan-2007
# Posted on: 29-Jan-2007 02:21:15   

It seems this recursive save only goes 2 levels deep in my object graph.

CaseEntitiesCollection Case Entity - dirty CaseAgencyRelation - dirty AgencyEntity - dirty

If I saveMulti the Case and the CaseAgencyRelation are saved but not the AgencyEntity.

I want to know what the rule is here...because if the object allows me to see editable agencies then it should save them or make them readonly right? I just want to know how it works with 3+ level object graphs.

I can't find details in the reference manual on how save works with self servicing objects.

Thanks

Sean

swegele
User
Posts: 33
Joined: 25-Jan-2007
# Posted on: 29-Jan-2007 03:09:43   

I think my question is answered in Otis' reply to TrevorJ http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=226&HighLight=1

The issue I mentioned is coming becuase it is a m:n relationship...and you don't support recursive saves in that scenario?

So tell me if I am right? - Recursive saves (savemulti(true)) on entities that have m:n child collections will only save the linking table because it may be objectified and nothing below that in the object graph.

Is that in the documentation somewhere that I missed?

Thanks so much

Sean

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 29-Jan-2007 07:25:11   

You should be saving the middle entity.

Check the Answer of How do I create a m:n relation between two entity objects?, in the Best practises -> How do I ... ?, in the LLBLGen Pro manual.