Need a Comparator or to implement Comparable for Collections.sort.
I'm guessing this is for the order in a display. If so, I've run into this problem too... but not solved it yet. I'm not sure where sorting needs to fit. I've tried setting an ORDER BY in the DAO and that works OK. I think putting an ordering column in the table makes sense, especially for one other project I'm doing. Off the top of my head I'm thinking maybe of generating Comparators separate from the DTO. Then one can pass the Comparator to use into the Collections.sort; so, one can choose to compare on any column. This might make sense since we know from the db what the db type is so can generate accurate comparison code but we do not know what column the user wants to use.
Thoughts on how best to support sorting?