Вопрос

I have condition part of my query as follows:

...
where foo.bar like '%:%'

the query would execute but with no result. I think it's because of the colon since it is a reserved char in HQL. So how can I escape it without sending the : as a parameter to my query.

I have already used '%\:%' and '%\\:%' with no success.

Это было полезно?

Решение

I found a solution: q=q.replaceAll(":","'||unistr('\\003A')||'");

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top