Re: Filtering array returned by an EO's relationship (D2J)
Re: Filtering array returned by an EO's relationship (D2J)
- Subject: Re: Filtering array returned by an EO's relationship (D2J)
- From: Arturo PĂ©rez <email@hidden>
- Date: Mon, 27 Oct 2003 07:35:10 -0500
On Monday, October 27, 2003, at 01:25 AM, Ray Ackland wrote:
I also imagine I can invoke a server side method to return the
filtered array. But is there a "simple" way to return just the
selection I want? I know I could use a fetch specification using the
desired qualifier, but will that relate the returned objects to the
entity I am calling it from, hence avoiding death and destruction for
the rest of my programme?
Fetch specifications are tied to an Entity. So, for example, a fetch
on Timesheet entities only returns
that kind of thing. This is as opposed to raw sql statements which
just return NSDictionaries. In fact,
once you see what's going on, you can even do a fetch for Timesheet
entities
by traversing its relationships to other Entities. So, eg, Timesheet
is related to Department and Department
is related to Employee. You can define a fetch on Timesheet that looks
like this
Timesheet->Department->Employee == $thisEmployee
and you'll get Timesheet entries related to only that Employee working
for that Department. Very nice.
So, if you're concerned about sending lots of data to the client I
would use a server-side method to
invoke a fetch spec to limit the data.
-------
WebObjects in Philadelphia. You want a cheesesteak with that?
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.