Querydsl - remove a space in the middle of COLUMN

Is there a way to make this query in querydsl?

SELECT *
FROM table
WHERE replace(column_name, ' ', '') = 'someValue';

StringPathof QClasshas no function. replace(), and for some characters (in particular, spaces in the middle) you need to remove from column_namebefore you test it with someValue.

An example column_name:ABC, DEF, AB *

If someValue- ABCthen there should be ABCand AB*.

+4
source share
1 answer

You can express a replacement call with

Expressions.stringTemplate("replace({0},'  ','')", columnPath)
+4
source

All Articles