Add ILike Restriction providing escape character

Description

Hi Folks,
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.
Thanks!

Environment

Hibernate 4.0.1-Final - Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

Activity

Show:
Gail Badner
December 17, 2016, 12:27 AM

, 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.

Assignee

Unassigned

Reporter

Nicolas Zdanovicz

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure