code: private static Object getValue(Object value) {
          if (value != null && value.getClass().isAssignableFrom(String.class)) {
              return ((String) value).replaceAll("^'", "").replaceAll("'$", "").replaceAll("''", "'");
          }
  
          return value;
      }
docs: Method to skip string literal as per JPA specification. if literal starts is enclose within "''" then skip "'"
  and include "'" in case of "''" replace it with "'".
  
  @param value
  value.
  
  @return replaced string in case of string, else will return original value.