tags:

views:

35

answers:

1

how do i sort the result( list ) returned byhibernate dynamically.Means i dont want to put the order by clause in hbm file. This is because i want to sort then differntly at different times.

i want to do nested sorting also. Consider the following. i have a course object which has a set of applications applications have attributes like time and priority now i want to sort them according to the priority first and within priority i want to sort them by time.

I am retrieving my application as cousreobject.getApplicationSet() .this is giving me a Set of allpications () for a particular course.

+1  A: 

Use a java.util.Comparator to sort your result list that's returned from the query? That can be a complex as you like, including nesting.

skaffman