• 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: Filtered to many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filtered to many relationship


  • Subject: Re: Filtered to many relationship
  • From: Mike Schrag <email@hidden>
  • Date: Fri, 2 May 2008 09:34:21 -0400

public NSArray fulltimeStudents() {
return EOQualifier. filteredArrayWithQualifier(students(), <your full-time student qualifier here>);
}
If you use the default EOGen templates, all relationships get a variant generated that can take a qualifier and an flag of whether or not to fetch from the db. For instance:

public NSArray<Student> students(EOQualifier qualifier) ...
public NSArray<Student> students(EOQualifier qualifier, boolean fetch) ...


the first one would fault in the relationship (if it's not already) and filter in memory, the second one would NOT fault the relationship and would instead construct a fetch spec and fetch from the database. So if your relationship is large, you could use the second variant and not end up loading the entire relationship into memory.

So your fulltimeStudents method could be implemented approximately like what Chuck is showing, but instead call through to these methods to make it a little nicer.

ms

_______________________________________________
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


References: 
 >Filtered to many relationship (From: Steve Peery <email@hidden>)
 >Re: Filtered to many relationship (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Detect SSL
  • Next by Date: Re: Filtered to many relationship
  • Previous by thread: Re: Filtered to many relationship
  • Next by thread: Request for enhancement
  • Index(es):
    • Date
    • Thread