Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetching from related object



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.


References: 
 >Re: Fetching from related object (From: Randall Perry <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.