0

Here, i am posting what i need from you!

DetachedCriteria criteria = DetachedCriteria.forEntityName(DomainEntity.tbl_user.toString);
criteria.addOrder(Order.asc("username"));
List<User> user = dao.getEntities(criteria);

This code is working fine, But sorting the names first UpperCase letters then LowerCase letters. I don't want that way.

But, I want both sorting at a time. Based on the alphabetical order. Here, i am using MySQL database.

Nallamachu
  • 1,420
  • 18
  • 34

1 Answers1

1

Are you looking for case-insensitive ordering ? Then try this :

Order.asc("username").ignoreCase()
AllTooSir
  • 48,828
  • 16
  • 130
  • 164