Re: Sort Ordering while using relationships
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.