Re: Fetching from related object
Re: Fetching from related object
- Subject: Re: Fetching from related object
- From: Arturo PĂ©rez <email@hidden>
- Date: Mon, 3 May 2004 20:23:55 -0400
On May 3, 2004, at 8:11 PM, Randall Perry wrote:
on 4/26/04 4:04 PM, Arturo Pirez at email@hidden wrote:
BTW, in a relatively unrelated aside, did you look at
EOUtilities.objectMatchingValues. It's a bit easier then writing that
fetchspec.
Am playing with this now. But given related EOModeler objects CustView
and
Log joined on custNo, how do I do a join given an existing CustView
object?
NSMutableDictionary dictionary = new NSMutableDictionary();
dictionary.takeValueForKey(custNo, ???);
dictionary.takeValueForKey(dateOneYearAgo, "dateTime");
logInfo = EOUtilities.objectsMatchingValues(ec, "Log", (NSDictionary)
dictionary);
Well, we never resolved why your faults from CustView to Log weren't
firing correctly. Given that fundamental problem, there's no specific
advice I can offer.
In general, though, an example of what you would need to do is: Assume
we want all the CustView objects that have a Log object from April 1,
2002. You'd do something like:
dictionary.takeValueForKey(dateAprilFirst2002, "logs.dateTime");
NSArray customersWithLogEntryOnAprilFirst2002 =
EOUtilities.objectsMatchingValues(ec,
"CustView",
(NSDictionary)dictionary);
WO/EOF will take care of writing the proper join statements for that.
----
WO in philadelphia - wanna cheesesteak with that?
Please visit 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.