I have a query created with Hibernate Criteria like this:
Criteria criteria = db.getSession().createCriteria(Vendor.class);
criteria.addOrder(Property.forName("shortName").asc());
List<Vendor> vendorList = criteria.list();
I would like the ordering to be case-insensitive, equivalent to the HQL query
FROM Vendor ve ORDER BY lower(ve.shortName)
How can I achieve this using Hibernate Criteria?
criteria.addOrder(Order.asc("shortName").ignoreCase());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With