Reputation: 149
I'm running a query on GAE's datastore:
List<Entity> messages =
datastore.prepare(query).asList(FetchOptions.Builder.withLimit(500));
I plan on manually adding a property to each message and would then like to sort the messages by the new property.
Any ideas on how to do this? Ideally I'd like to sort by multiple variables.
Upvotes: 1
Views: 205
Reputation: 15229
Well you can make separate java.util.Comparator<SortPropertyType>
implementations and then do a
Collections.sort(myList,myComparatorInstance);
do sort using a certain field.
Upvotes: 1