I am new to Spring3 and Hibernate the following code works great but I am trying to find a way to have my list returned in sort order by the date field. Can someone please show
Either have the database do it or Java, your choice. Here's how to do it in Java:
List<Friend> friends = sessionFactory.getCurrentSession()
.createCriteria(Friend.class)
.add(Example.create(friend))
.list();
Collections.sort(friends);
return friends;
.addOrder( Order.desc("date") )
Check the examples in the documentation