Hibernate's Criteria
API has Restrictions.ilike
function which has the following contract:
A case-insensitive "like", similar to Postgres ilike operator
That's cool. But the same class also has like
function, having much more vague contract:
Apply a "like" constraint to the named property
example
Criteria cr = session.createCriteria(Employee.class);
// To get records having fistName starting with zara
cr.add(Restrictions.like("firstName", "zara%"));
// Case sensitive form of the above restriction.
cr.add(Restrictions.ilike("firstName", "zara%"));