sort returned entities by related entity attribute
sort returned entities by related entity attribute
- Subject: sort returned entities by related entity attribute
- From: Jeff Schmitz <email@hidden>
- Date: Sat, 05 Jul 2008 22:35:04 -0500
Hello, This is really hard to put down succinctly, so I'll try to do it a couple different ways: Is there an easy way to base the sort order of an array entities returned on an attribute of an entity related to each of the returned entities?
IOW:
startEntity to-many returnedEntity sorted by returnedEntity to-one subEntity.sortKey.
Note that the returnedEntity owns, and propogates its primary key to, the subEntity.
e.g. This was basically my first try (I'm using wonder), but since I was applying a subEntity sort key on a returnedEntity array, it of course choked.
EOSortOrdering[] sortBy = { new EOSortOrdering(subEntity.SORT_KEY, EOSortOrdering.CompareDescending)}; NSArray<EOSortOrdering> sortByArray = new NSArray<EOSortOrdering>( sortBy); // Sort
NSArray<Entry> entities = this.returnedEntity(null, sortByArray, false); Thanks! Jeff |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden