Re: Memory Management
Re: Memory Management
- Subject: Re: Memory Management
- From: Jeff Schmitz <email@hidden>
- Date: Fri, 06 Mar 2009 21:55:36 -0600
On Mar 6, 2009, at 7:05 PM, Chuck Hill wrote:
That is _batch_ fetching, not _pre_fetching. They do similar
things, but prefetching is easier to use for most cases.
I'm working on the prefetching and was wondering, is there any way to
prefetch several "layers" of relationships into the editing context
all in one call? Or can you only go down one layer at a time?
Here's what I've come up with to prefetch all the entries in a pool,
but I would like to be able to specify that all those entries Games
also be pre-fetched (and so on):
public static Pool
fetchPoolWithNameAndPrefetchEntries(EOEditingContext ec, String name,
byte poolType) {
EOQualifier poolQual = Pool.POOL_TYPE.eq(poolType).and(
Pool.NAME.likeInsensitive(name));
ERXFetchSpecification poolFetch = new
ERXFetchSpecification(_Pool.ENTITY_NAME, poolQual, null);
NSArray <String> keyPaths = new NSArray(new String[]
{Pool.ENTRIES_KEY});
poolFetch.setPrefetchingRelationshipKeyPaths(keyPaths);
return (Pool)
ec.objectsWithFetchSpecification(poolFetch).lastObject();
}
_______________________________________________
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