这里Expense是个自定义的类
java集合容器类接口的总结
[url]http://lehsyh.iteye.com/blog/588395[/url]
List list=this.getExpenseService().getListByHQL("Expense",0,10,sql);
//根据Expense中类别(type属性)对List<Expense>排序
Collections.sort(list, new Comparator<Expense>(){
public int compare(Expense e1, Expense e2) {
// TODO Auto-generated method stub
return e2.getType().compareTo(e1.getType());//这里是type
}
});
java集合容器类接口的总结
[url]http://lehsyh.iteye.com/blog/588395[/url]