How can I use LIKE expression for case insensitive filtering in hibernate?
The corresponding entry in my hibernate file is:
<filter name="applicantNameFilter" condition="first_name LIKE :nameFilter"/>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this
or
For Reference
Using ILIKE:
Using Regexp operators (see Functions and Operators in the docs):
Using UPPER() or LOWER() to change the case of the field before comparison;
this approach can be better than 1) or 2) because these functions may be
indexed, and thus if you are doing a “begins with” or “exact match” search
your query may be indexed:
SELECT * FROM sometable WHERE UPPER(textfield) LIKE (UPPER('value') || '%');If most of your searches are “anywhere in field” searches on large text
fields, I’d reccomend a look at the two “full text search” tools available in
PostgreSQL, one in the /contrib of your source, the second from openFTS.org.
This is java code
User criteria as