Skip to content

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

@LordOfTheHelmet

Description

@LordOfTheHelmet

To reproduce this:

BooleanExpression patternPredicate = company.name.toLowerCase().like("%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(BasicBinder.java:84) - 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 = company.name.toLowerCase().like("%My! Text%".replaceAll("!", "!!"), '!');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions