I want to implement some universal filter with Hibernate Criteria. It should work like LIKE operator from SQL:
I recommend using a Query object instead of the Criteria object, in this case.
I can't remember if Criteria passes things it doesn't understand straight through to the database like a Query object will do. Basically what this would mean is that if you used a function that was database specific that the Hibernate parser didn't understand, it would pass it "as is" to the database.
Example:
Query queryObject = session.createQuery("from ClassName where VARIABLENAME like '%'||anyvaluehere||'%' order by VARIABLENAME");
List resultList= queryObject.list();
For more see here