How do I sort a many-to-many collection mapped as a Map using filter?
For example, if I have a map between Student and Class with 'priority' as the map key.
and I want to sort the list of Classes for a student based on the class name. (the sorting criteria is decided by the user at runtime)
looks like when I use
Code:
Session.filter(map, "ORDER BY this.name ASC")
the resulting collection is a
List (!) containing elements of Class in the specified order, which is great except I cannot retrieve the Map key (priority) any more.
Any help would be greatly appreciated....