Hello, I'm not sure if this is the best forum for my question, sorting a Set seems to fit it. I'm working in .groovy files and have a hibernate.collection.PersistentSet that I need to sort in the following form:
The PersistentSet is returned with sp.repGroupProfiles, where sp is a db domain object and repGroupProfiles is part of has-many relation. I have sorting algorithms at hand way back from school, but before using them, I'd like to see if there is something else I could use. Ideally, I'd like to be able to sort right in render statement, but not sure if that's at all possible. If anyone knows of elegant solutions to this, I'd sure be happy to hear about them. Thank you in advance.
Arrays.sort either takes an array of comparable objects, or an object array and a matching comparator. It returns void.
liliya woland
Ranch Hand
Joined: Apr 11, 2006
Posts: 134
posted
0
Well, Here is what works:
The problem is then I loose bd objects, and have only a string arr, which means I cant use other properties of repGroupProfiles like ids. It would work, it is just not ideal.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.