views:

12

answers:

1

I want to do case insensitive search in hibernate Query. I can do it with Criteria but it is not an option for me right now. The method which fire query takes a query string as input and it is used by other components. Is it possible to enable case insensitive for Hibernate session or prepare criteria object from hql query.

A: 

You can use the lower or upper functions mentioned here.

from User u where lower(u.name) = 'scott'
binil