Re: Filtered to many relationship
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