Re: Fetching from related object
Re: Fetching from related object
- Subject: Re: Fetching from related object
- From: Chuck Hill <email@hidden>
- Date: Sun, 25 Apr 2004 13:09:31 -0700
Somewhere in your code / model you are doing something really, really wrong.
Chuck
P.S. Attributes and relationships should have names staring with a lower
case letter. The use of "Log" as an relationship name may be part of your
problems.
P.P.S. It is customary (and sensible) to give to-many relationships plural
names.
At 03:43 PM 25/04/2004 -0400, Randall Perry wrote:
>Got this to work by adding this to the custInfo fetch:
> custFetchSpec.setPrefetchingRelationshipKeyPaths(new NSArray("Log"));
>
>>> So, you fetch a CustInfo as above. Now, how do you get the Log objects
>>> associated with it? The easiest best performing way is to do
>>> NSArray arrayOfLog = (NSArray)custInfo.valueForKey("logEntries");
>>>
>>
>> Tried the code above:
>> logInfo = (NSArray)custInfo.valueForKey("Log");
>>
>> It runs ok but returns an empty array.
>>
>> Checked the db and the cust I was using had 17 related log records.
>>
>> With the help of the docs and this list I've discovered at least 3
methods of
>> doing what I want...unfortunately I'm 0 for 3. Drat!-(
>
>
>--
>Randall Perry
>sysTame
>
>Xserve Web Hosting/Co-location
>Website Development/Promotion
>Mac Consulting/Sales
>
>http://www.systame.com/
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.