working with criteria queries, we found the following situation:
"It's not easy as it's supposed to be, to build a criterion using Restrictions.Ilike providing escape character".
Restrictions is a class with package-default visibility. So in order to workaround this issue we've done the following steps:
a. Created the same package (org.hibernate.criterion) in our project.
b. Extended class Restrictions and Overwrited method ILike, creating LikeExpression using protected constructor providing escape character.
Maybe there's a chance to provide default value as property for LikeExpression's escape char or something.
Hibernate 4.0.1-Final - Oracle Database 11g Enterprise Edition Release 220.127.116.11.0 - 64bit Production
, the legacy Hibernate org.hibernate.Criteria API, which should be considered deprecated: https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#appendix-legacy-criteria
We have no plans to make improvements to this legacy API. If you create a pull request with a test case and fix, then maybe someone will apply it. No promises though.