根据主键查找记录

@param parameter
@return
19121
public String findById(final Map<String, Object> parameter) {
    return new SQL() {
      {
        Class<?> clazz = (Class<?>) parameter.get(CLASS_KEY);
        SELECT("*");
        FROM(EntityUtil.getTableName(clazz));
        WHERE("id=#{" + PARA_KEY + '}');
      }
    }.toString();
  }
1156830
public HttpRequest withoutParameter(String parameter) {
		if(Strings.isValid(parameter)) {
			for(HttpParameter p : parameters) {
				if(parameter.equals(p.getName())) {
					parameters.remove(p);
				}
			}
		}
		return this;
	}
729689
@Override
	public Parameter doParameter(final Parameter parameter) {
		if (getFilters().isEmpty()) {
			return parameter;
		}
		Parameter param = parameter;
		for (final SqlFilter filter : getFilters()) {
			param = filter.doParameter(param);
		}
		return param;
	}
680078
private static boolean isRepoWS(String parameter)
   {
      String repWS = parameter;
      repWS = repWS.replaceAll("\\\\", "/");

      if ( !repWS.matches("[/][^/]+") && !repWS.matches("[/][^/]+[/][^/]+"))
      {
         return false;
      }
      else
      {
         return true;
      }
   }
1239560
public static CmsCroppingParamBean parseScaleParam(String param) {

        CmsCroppingParamBean result = new CmsCroppingParamBean();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(param)) {
            return result;
        }
        String[] parameters = param.split(SCALE_PARAM_DELIMITER);
        for (int i = 0; i < parameters.length; i++) {
            String scaleParam = parameters[i].trim();
            if (scaleParam.startsWith(SCALE_PARAM_TARGETHEIGHT + SCALE_PARAM_COLON)) {
                result.setTargetHeight(parseValue(SCALE_PARAM_TARGETHEIGHT, scaleParam));
                continue;
            }
            if (scaleParam.startsWith(SCALE_PARAM_TARGETWIDTH + SCALE_PARAM_COLON)) {
                result.setTargetWidth(parseValue(SCALE_PARAM_TARGETWIDTH, scaleParam));
                continue;
            }
            if (scaleParam.startsWith(SCALE_PARAM_CROP_X + SCALE_PARAM_COLON)) {
                result.setCropX(parseValue(SCALE_PARAM_CROP_X, scaleParam));
                continue;
            }
            if (scaleParam.startsWith(SCALE_PARAM_CROP_Y + SCALE_PARAM_COLON)) {
                result.setCropY(parseValue(SCALE_PARAM_CROP_Y, scaleParam));
                continue;
            }
            if (scaleParam.startsWith(SCALE_PARAM_CROP_HEIGHT + SCALE_PARAM_COLON)) {
                result.setCropHeight(parseValue(SCALE_PARAM_CROP_HEIGHT, scaleParam));
                continue;
            }
            if (scaleParam.startsWith(SCALE_PARAM_CROP_WIDTH + SCALE_PARAM_COLON)) {
                result.setCropWidth(parseValue(SCALE_PARAM_CROP_WIDTH, scaleParam));
                continue;
            }
        }
        return result;
    }
524027
public String getParameter(String name) {

        String[] p = getParameterMap().get(name);
        if (p != null) {
            return p[0];
        }

        return null;
    }
412919
private Sql getPreperSQLWithParameters(String query, Map<String, Object> parameters) {
		// 检索query语句中所有:key的标记
		Pattern pattern = Pattern.compile(":\\w+");
		Matcher matcher = pattern.matcher(query);

		// 构建<key, index>值对
		int index = 1;
		Map<String, Integer> keyIndexs = new HashMap<String, Integer>();
		while (matcher.find()) {
			String word = matcher.group();
			if (word.startsWith(":")) {
				keyIndexs.put(word.substring(1), index++);
			}
		}

		// 构建<index, value>值对
		Map<Integer, Object> prepareValue = new HashMap<Integer, Object>();
		Set<String> paramKeySet = parameters.keySet();
		for (String paramKey : paramKeySet) {
			Integer preIndex = keyIndexs.get(paramKey);
			Object preValue = parameters.get(paramKey);

			prepareValue.put(preIndex, preValue);
		}

		// 替换所有的变量为"?"
		query = matcher.replaceAll("?");

		Sql sql = new Sql(query, parameters);
		sql.setPreperStatement(true);
		sql.setKeyIndexs(keyIndexs);
		sql.setPreperValues(prepareValue);

		return sql;
	}
663384
public static Map<String, QueryParameter> toMap(List<QueryParameter> parameters) {
        Map<String, QueryParameter> map = new HashMap<String, QueryParameter>();
        for (QueryParameter qp : parameters) {
            map.put(qp.getName(), qp);
        }
        return map;
    }
642102
private static List<String> getGenericTypeParameters(String parameters) {
        List<String> paramList = new ArrayList<String>();
        int balanced = 0;
        StringBuilder current = new StringBuilder();
        for (int i = 0; i < parameters.length(); i++) {
            char c = parameters.charAt(i);
            if (balanced == 0 && c == ',') {
                paramList.add(current.toString().trim());
                current = new StringBuilder();
                continue;
            } else if (c == '<') {
                balanced++;
            } else if (c == '>') {
                balanced--;
            }
            current.append(c);
        }
        paramList.add(current.toString());
        return paramList;
    }
1283614
public static void addParameter(MethodDeclaration method, Parameter parameter) {
        List<Parameter> parameters = method.getParameters();
        if (parameters == null) {
            parameters = new ArrayList<Parameter>();
            method.setParameters(parameters);
        }
        parameters.add(parameter);
    }
670674
public String getHintImpl(String hint, String parameter, String separator) {
		if (hint == null) {
			return null;
		}
		if (hint.indexOf(parameter) == -1) {
			return null;
		}
		String[] split = hint.split("[" + separator + "]");
		split = trim(split);
		for (int i = 0; i < split.length; i++) {
			int indexOfEq = split[i].indexOf("=");
			if (indexOfEq == -1) {
				if (split[i].equals(parameter)) {
					return "";
				}
			} else {
				if (split[i].substring(0, indexOfEq).trim().equals(parameter)) {
					return split[i].substring(indexOfEq + 1).trim();
				}
			}
		}

		// not found
		return null;
	}
839592
public <T extends Parameters> T read(T parameters) throws AponParseException {
        if (parameters == null) {
            throw new IllegalArgumentException("parameters must not be null");
        }
        addable = parameters.isAddable();
        try {
            valuelize(parameters, NO_CONTROL_CHAR, null, null, null, false);
        } catch (AponParseException e) {
            throw e;
        } catch (Exception e) {
            throw new AponParseException("Could not read an APON formatted document into a Parameters object", e);
        }
        return parameters;
    }
340544
@Override
	public Parameter getParam(final String paramName) {
		Parameter param = getBindParameter(paramName);
		if (param == null) {
			Map<String, Parameter> constParams = getConstParameterMap();
			if (constParams != null) {
				param = constParams.get(paramName.toUpperCase());
			}
		}
		return param;
	}
422045
public SqlPara getSqlParaByString(String content, Object... paras) {
		Template template = engine.getTemplateByString(content);
		
		SqlPara sqlPara = new SqlPara();
		Map data = new HashMap();
		data.put(SQL_PARA_KEY, sqlPara);
		data.put(PARA_ARRAY_KEY, paras);
		sqlPara.setSql(template.renderToString(data));
		// data 为本方法中创建，不会污染用户数据，无需移除 SQL_PARA_KEY、PARA_ARRAY_KEY
		return sqlPara;
	}
91069
public static String getParamInfo(Parameterizable p) {
      StringBuilder sb = new StringBuilder(p.getParameters().size() * 20);
      for (Parameter e : p.getParameters().values()) {
         if (e.getValue() != null && !e.getValue().equals(e.getDefault())) {
            sb.append(e.toString()).append("\n");
         }
      }
      return sb.toString();
   }
335012
public Parameter<?> getParameter(String name) {
        Collection<Parameter<?>> extnParameters = getParameters();

        for (Parameter<?> extnParameter : extnParameters) {
            if (extnParameter.name().equals(name)) {
                return extnParameter;
            }
        }
        
        return null;
    }
1037519
void addParameter(String parameter) {

        TextField textField = new TextField();
        if (parameter != null) {
            textField.setValue(parameter);
        }
        CmsRemovableFormRow<TextField> row = new CmsRemovableFormRow<TextField>(
            textField,
            CmsVaadinUtils.getMessageText(Messages.GUI_SITE_REMOVE_PARAMETER_0));
        row.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARAMETER_0));
        row.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_PARAMETER_HELP_0));
        m_parameter.addComponent(row);
    }