• 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: Fetching from related object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetching from related object


  • Subject: Re: Fetching from related object
  • From: Arturo PĂ©rez <email@hidden>
  • Date: Sat, 24 Apr 2004 22:46:05 -0400

On Apr 24, 2004, at 9:56 PM, Randall Perry wrote:

On Apr 23, 2004, at 6:54 PM, Randall Perry wrote:

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");


Is it possible to use a filter with this method? I only want log records for
the past year.

You can use the qualifierWithQualifierFormat and filteredArrayWithQualifier to filter it in memory. Obviously, at some point a performance issue will crop up. It would only be an issue if a user has thousands of Log entries associated with it. At that point I would my preference is to use model-based fetch specifications.


For my latest thing what I did was make a database view. I didn't want to have to filter every time I used the relationship.

Notice that there is no fetch specification involved.  EOF takes care
of it all for you.  The SELECT, the join the whole nine yards.
Pretty nifty.

Yep, by far the most important reason to use WO/EOF. One of the products I had the pleasure of helping create with WO/EOF couldn't be done with any other tool in the timeframe necessary (they tried). And it was because of this sort of thing.


----
WO in philadelphia - wanna cheesesteak with that?
Please visit http://webobjects.meetup.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.


  • Follow-Ups:
    • Re: Fetching from related object
      • From: Randall Perry <email@hidden>
  • Prev by Date: Re: Fetching from related object
  • Next by Date: WOB and class static variables
  • Previous by thread: Re: Fetching from related object
  • Next by thread: Re: Fetching from related object
  • Index(es):
    • Date
    • Thread