Question

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.

Était-ce utile?

La solution

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

Order.asc("username").ignoreCase()
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top