Hibernate version:3.2
I'm using the Query By Example (QBE) technique to get a list of Facilities. I want to sort the results by Facility name. Everything works accept the the "ignoreCase()" has no effect.
Am I doing something wrong?
Code:
public static List findFacility(Session hSession, Facility facility, int firstResult, int maxResults)
throws HibernateException {
List facilities;
try {
Example exampleFacility= Example.create(facility)
.enableLike(MatchMode.ANYWHERE)
.excludeProperty("privateOwnedFlag")
.excludeProperty("smallCommunityExceptionFlag");
facilities = hSession.createCriteria(Facility.class)
.add(exampleFacility)
.addOrder(Order.asc("name").ignoreCase())
.setFirstResult(firstResult)
.setMaxResults(maxResults)
.list();
} catch (HibernateException he) {
log.error("Unable to search for the Facilities by example ");
log.error("Unable to search for the Facility Error is : " + he);
throw (he);
}
return facilities;
}