• 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: Sort Ordering while using relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort Ordering while using relationships


  • Subject: Re: Sort Ordering while using relationships
  • From: Art Isbell <email@hidden>
  • Date: Fri, 9 May 2003 13:28:09 -1000

On Friday, May 9, 2003, at 07:10  AM, Anurag Khare wrote:

In my EOModel EntityA is having a to-many relationship with EntityB. I am able to fetch records from EntityB through relationship speicfying fetch spec containing Relationship.EntityBAttribute. But in SortOrdering option when I specify Relationship.EntityBAttribute, it dooesn't display ordered objects. It looks as if I haven't used any SortOrdering option in the EOModel.

Is the generated SQL specifying the sorting that you expect?

I am definitely missing something. Or is it that I can not use EntityBAttribute to sort order objects?

The EntityA objects should be sorted by Relationship.EntityBAttribute, but the EntityB objects won't be sorted in this manner. If you've fetched EntityA objects, you can sort those EntityB objects related to a particular EntityA object in memory:


NSArray sortedObjects = EOSortOrdering.sortedArrayUsingKeyOrderArray(entityAObject.entityBs, new NSArray(new EOSortOrdering(entityBAttributeName, EOSortOrdering.CompareAscending)));

Aloha,
Art
_______________________________________________
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: 
 >Sort Ordering while using relationships (From: "Anurag Khare" <email@hidden>)

  • Prev by Date: Re: downloading dynamic images
  • Next by Date: Re: Outer Join Question
  • Previous by thread: Re: Sort Ordering while using relationships
  • Next by thread: Re: Sort Ordering while using relationships
  • Index(es):
    • Date
    • Thread