In type String
to replace all -
with *
I can write
String firstName = firstName.replaceAll("-", "*");
Is there a way to do the same in Criteria Expression
?
I need to remove special characters from the first name before comparing it to the pattern in like
method.
My expression:
Expression<String> firstName = root.get("firstName");
builder.like(firstName, pattern);