Re: clearing a toMany relationship fault
Re: clearing a toMany relationship fault
- Subject: Re: clearing a toMany relationship fault
- From: Lachlan Deck <email@hidden>
- Date: Fri, 5 Sep 2008 11:39:41 +1000
On 05/09/2008, at 3:47 AM, Mike Schrag wrote:
Shallow and Deep, with an optional depth setting?
Shallow is the current EO and its toMany, then stops.
Deep continues on through the graph to a depth of 'depth' ?
Shallow is a wrapper method of Deep with 'depth = 0' ?
This could be a very expensive operation if mis-used, but is badly
needed.
Ultimately I think this has to be rules-based ... This same problem
happens when serializing object graphs over JSON services ... Which
to-many's do you include? Which do you live as faults? I've looked
at it a million ways and I think you can only ever do it right with
a d2wish rules definition that lets you pick the context you're in
to determine which keypaths end up in vs out and faulted vs not.
Okay - creating these rules is quite simple.
You have two properties lists:
er.extensions.ERXGenericRecord.relationshipCacheWhiteList = {\
_ALL = "any,relationship,named,from,any,entity";\
_MISFITS = "Entity,Names,That,Don't,apply,to,_ALL";\
EntityName = "comma,separated,keypaths,that,can,be,refreshed";\
}
er.extensions.ERXGenericRecord.relationshipCacheBlackList = {\
_ALL = "any,relationship,named,from,any,entity";\
_MISFITS = "Entity,Names,That,Don't,apply,to,_ALL";\
EntityName = "comma,separated,keypaths,that,cannot,be,refreshed";\
}
er.extensions.ERXGenericRecord.reverseToManyRelationshipsRefresh=true
How's that?
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden