• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: clearing a toMany relationship fault
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clearing a toMany relationship fault


  • Subject: Re: clearing a toMany relationship fault
  • From: Michael DeMan <email@hidden>
  • Date: Thu, 04 Sep 2008 09:27:43 -0700

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.

- mike


Chuck Hill wrote:
This is something that really should get done as part of a refreshing fetch. I think bugs have been filed on this, but another voice increases the priority.

Was there some other place you were thinking of having this called automatically? It might be useful to add a refresh() method to ERXGenericRecord that would refresh the snapshot and all to-many() relationships. But then... what about the related objects? How far do you go?


Chuck


On Sep 3, 2008, at 5:04 AM, Lachlan Deck wrote:

Okay, so there's ERXEOControlUtilities.clearSnapshotForRelationshipNamed[InDatabase] (which saves me a few lines of code :) but which doesn't appear to be auto-called from anywhere(?). Would it be useful for there to be a property that does something like this automatically?

What I've now got in my ERXGenericRecord subclass now is:
public void awakeFromFetch( EOEditingContext editingContext )
{
super.awakeFromFetch( editingContext );
if ( editingContext == EOSharedEditingContext.defaultSharedEditingContext()
&& ISHApplication.ishApplication().hasFetchedInitialSharedRecordsForEntity( entityName() ) )
{
for ( Enumeration< ? > en = classDescription().toOneRelationshipKeys().objectEnumerator(); en.hasMoreElements(); )
{
String key = en.nextElement().toString();
EORelationship inverseRelationship = entity().relationshipNamed( key ).inverseRelationship();
if ( inverseRelationship != null && inverseRelationship.isToMany() )
{
EOEnterpriseObject eo = ( EOEnterpriseObject )valueForKey( key );
if ( eo != null )
// this next line covers Anjo's code from the wiki page below
ERXEOControlUtilities.clearSnapshotForRelationshipNamed( eo, inverseRelationship.name() );
}
}
}
}


This is working fine. Is there any suggestions on anything else that might need doing for completeness?

On 03/09/2008, at 5:07 PM, Lachlan Deck wrote:

Hi Simon,

On 03/09/2008, at 4:37 PM, Simon McLean wrote:

this might help:

http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/Caching_and_Freshness#Refreshing_Many-to-Many_Relationships


Yes - that's exactly the sort of stuff I'm trying to solve.

Question: is there some property in Wonder that does this automatically?

On 3 Sep 2008, at 07:34, Lachlan Deck wrote:

Hi there,

just wondering ... how would I go about clearing the faults for certain toMany relationships of an object. i.e., I'm iterating through certain toMany keys and I want to obtain the faults without firing them (best case scenario) and then clear them so that they are refreshed.

Any suggestions?

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


_______________________________________________
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


  • Follow-Ups:
    • Re: clearing a toMany relationship fault
      • From: Mike Schrag <email@hidden>
    • Re: clearing a toMany relationship fault
      • From: Chuck Hill <email@hidden>
References: 
 >clearing a toMany relationship fault (From: Lachlan Deck <email@hidden>)
 >Re: clearing a toMany relationship fault (From: Lachlan Deck <email@hidden>)
 >Re: clearing a toMany relationship fault (From: Lachlan Deck <email@hidden>)
 >Re: clearing a toMany relationship fault (From: Chuck Hill <email@hidden>)

  • Prev by Date: Customizing random value generation
  • Next by Date: Re: Inherited Relationships using Different Destinations
  • Previous by thread: Re: clearing a toMany relationship fault
  • Next by thread: Re: clearing a toMany relationship fault
  • Index(es):
    • Date
    • Thread