Using NSArray functions in WO
Using NSArray functions in WO
- Subject: Using NSArray functions in WO
- From: Ray Ackland <email@hidden>
- Date: Thu, 11 Sep 2003 20:15:16 +1200
In the book "Enterprise Objects" there is an example of using NSArray
functions. In the code snippet (located in
/Developer/Examples/JavaWebObjects/Frameworks/JavaRealEstate), the
webobjectsexamples.realestate.server.Agent class goes:
public Number averageRating() {
if (_averageRating == null) {
_averageRating =
(Number)(ratings().valueForKey("@avg.rating.rating"));
}
return _averageRating;
}
I am trying to understand the parameters given. Specifically, the
ratings() refers to the array of EO objects, the @avg means average,
but what are the two ratings for? I expect one of them is saying to
average the values in the rating field, but what about the other?
I have used a similar expression in my code, but only having one part
following the @operator, with success. Am I missing something of
importance?
Thanks,
Ray.
_______________________________________________
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.