0

I found %% expression on spring batch source. Is this SpEL? How do I use %% expression?

protected String getQuery(String base) {
    return StringUtils.replace(base, "%PREFIX%", tablePrefix);
}

enter image description here

enter image description here

Jason Moon
  • 11
  • 3

1 Answers1

0

This is not spel. It's used to replace the string with some target value. For example,

String base = "How are me?";
String target = "me";
String replacement = "you";
String result = StringUtils.replace(base, target, replacement);
Navneet Singh
  • 211
  • 1
  • 9
  • Thank you,I know replace util, I want to know what "%PREFIX%" expression is and how to use this. – Jason Moon Dec 28 '21 at 06:21
  • it is used to modify the template query. See this => private static final String SQL_DELETE_BATCH_JOB_EXECUTION = "DELETE FROM %PREFIX%JOB_EXECUTION where CREATE_TIME < ?"; – Navneet Singh Dec 28 '21 at 06:26
  • 1
    Thank you.. just expression to replace the string... I was confused – Jason Moon Dec 28 '21 at 07:34