Escape character in LIKE expressions is not escaped by querydsl #438

LordOfTheHelmet opened this Issue Jun 11, 2013 · 3 comments


None yet

2 participants


To reproduce this:

BooleanExpression patternPredicate ="%My! Text%");

When i execute this i get the exception:

java.sql.SQLDataException: ORA-01424: Zeichen nach dem Escape-Zeichen fehlen oder sind ungültig

The SQL generated from the expression looks like:

lower(company0_.NAME) like ? escape '!'

and the bound value is:

TRACE org.hibernate.type.descriptor.sql.BasicBinder.bind( - binding parameter [1] as [VARCHAR] - %My! Text%

Shouldn't querydsl escape the escape character for me? Otherwise i have to do something like:

BooleanExpression patternPredicate ="%My! Text%".replaceAll("!", "!!"), '!');

That would also mean that actual escaping is only available when the other like variants are used."\\%")

would need to be written as"\\%", '\\')

But maybe this makes sense, since it makes escaping more explicit.


Released in 3.2.1

@timowest timowest closed this Jun 26, 2013

Thanks for accepting and implementing it!

@timowest timowest added this to the 3.2.1 milestone Apr 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment