• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using NSArray functions in WO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using NSArray functions in WO


  • Subject: Re: Using NSArray functions in WO
  • From: "Adam Chan" <email@hidden>
  • Date: Thu, 11 Sep 2003 09:23:01 -0600

That is the way how the example EOModel was set. The class "Agent"  has a
to-many relation to a EOEntity called "Rating", and this "Rating" class has
a class poperty called "rating" which returns a Number.

----- Original Message -----
From: "Ray Ackland" <email@hidden>
To: <email@hidden>
Sent: Thursday, September 11, 2003 2:15 AM
Subject: Using NSArray functions in WO


> 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.
_______________________________________________
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: 
 >Using NSArray functions in WO (From: Ray Ackland <email@hidden>)

  • Prev by Date: Re: EO & MySQL tedious error
  • Next by Date: Re: Best approach to handling times
  • Previous by thread: Using NSArray functions in WO
  • Next by thread: bug with WOContext.completeURLWithRequestHandlerKey
  • Index(es):
    • Date
    • Thread