Package org.jeecgframework.minidao.util

Examples of org.jeecgframework.minidao.util.FreemarkerParseFactory


    String executeSql = null;
   
    // step.2.获取SQL模板内容
    // step.3.通过模板引擎给SQL模板装载参数,解析生成可执行SQL
    if(StringUtils.isNotEmpty(templateSql)){
      executeSql = new FreemarkerParseFactory().parseTemplateContent(templateSql, sqlParamsMap);
    }else{
      // update-begin--Author:fancq  Date:20131225 for:sql放到dao层同样目录
      // update-begin--Author:zhaojunfu  Date:20140418 for:扫描规则-首先扫描同位置sql目录,如果没找到文件再搜索dao目录
      String sqlTempletPath = "/"+method.getDeclaringClass().getName().replace(".", "/").replace("/dao/", "/sql/")+"_"+method.getName()+".sql";
      URL sqlFileUrl = this.getClass().getClassLoader().getResource(sqlTempletPath);
      if(sqlFileUrl==null){
        sqlTempletPath = "/"+method.getDeclaringClass().getName().replace(".", "/")+"_"+method.getName()+".sql";
      }
      // update-end--Author:fancq  Date:20131225 for:sql放到dao层同样目录
      // update-end--Author:zhaojunfu  Date:20140418 for:扫描规则:首先扫描同位置sql目录,如果没找到文件再搜索dao目录
      logger.debug("MiniDao-SQL-Path:"+sqlTempletPath);
      executeSql = new FreemarkerParseFactory().parseTemplate(sqlTempletPath, sqlParamsMap);
    }
    return getSqlText(executeSql);
  }
View Full Code Here

TOP

Related Classes of org.jeecgframework.minidao.util.FreemarkerParseFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.