code: private String toSQLPattern(String attribute) {
          String pattern = attribute.replace("*", "%");
          if (!pattern.startsWith("%")) {
              pattern = "%" + pattern;
          }
          if (!pattern.endsWith("%")) {
              pattern = pattern.concat("%");
          }
          return pattern;
      }
docs: To sql pattern.
  
  @param attribute the attribute
  @return the string