public String replaceVariables(String src,Map<String,String> variables,EntityMapping entity,ResultSet records){
        Pattern pattern = Pattern.compile("\\$([^\\?,\\]\\}\\s}]+)");
        Matcher matcher=pattern.matcher(src);
        while(matcher.find()){
            String key = matcher.group(1);
            if(variables.containsKey(key)){
                String value = variables.get(key);
                Object real_value = null;
                if(value.startsWith("this.")){
                    value = value.substring("this.".length());
                    try {
                        int index = records.findColumn(value);
                        real_value = getColumnValue(records, index);
                    } catch (SQLException e) {
                        e.printStackTrace();
                    }
                }else{
                    real_value = value;
                }
                if(real_value!=null){
                    src = src.replaceAll("\\$"+key+"",real_value.toString());
                }
            }
        }
        return src;
    }