Package cn.org.rapid_framework.generator.Generator

Examples of cn.org.rapid_framework.generator.Generator.GeneratorModel


    public void test_generate_by_mybatis_user_info() throws Exception {
      g.setTemplateRootDir(FileHelper.getFileByClassLoader("for_generate_by_sql_config"));
        File file = FileHelper.getFileByClassLoader("cn/org/rapid_framework/generator/ext/tableconfig/mybatis_user_info.xml");
        TableConfig t = new TableConfigXmlBuilder().parseFromXML(file);
        GeneratorModel gm = newFromTable(t);
        g.generateBy(gm.templateModel, gm.filePathModel);
       
        g.setTemplateRootDir(FileHelper.getFileByClassLoader("for_generate_by_sql"));
        for(Sql sql : t.getSqls()) {
            gm = newFromSql(sql,t);
View Full Code Here


        Map filePathModel = new HashMap();
        filePathModel.putAll(GeneratorProperties.getProperties());
        filePathModel.putAll(BeanHelper.describe(t));
        filePathModel.putAll(BeanHelper.describe(sql));
        setShareVars(filePathModel);
        GeneratorModel gm = new GeneratorModel(templateModel,filePathModel);
        return gm;
    }
View Full Code Here

       
        Map filePathModel = new HashMap();
        setShareVars(filePathModel);
        filePathModel.putAll(GeneratorProperties.getProperties());
        filePathModel.putAll(BeanHelper.describe(t));
        GeneratorModel gm = new GeneratorModel(templateModel,filePathModel);
        return gm;
    }
View Full Code Here

    g.setOutRootDir("./target/temp/sql");
  }

  public void test_select_with_between() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select * from user_info where birth_date between #minBirthDate# and #maxBirthDate# and username = :specialUsername and sex <= :specialSex and age >= ${specialAge} and password <> #{password}");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

    g.generateBy(gm.templateModel, gm.filePathModel);
  }
 
  public void test_select_with_no_parameers() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select * from user_info");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

    g.generateBy(gm.templateModel, gm.filePathModel);
  }

  public void test_select_with_2_parameers() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select * from user_info where username = :username and password =:password ");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

    g.generateBy(gm.templateModel, gm.filePathModel);
  }

  public void test_select_with_in_parameers() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select * from user_info where username = :username and password =:password and age in (:age)");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

    g.generateBy(gm.templateModel, gm.filePathModel);
  }
 
  public void test_select_with_many_parameers() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select * from user_info where username = :username and password =:password and age = :age and sex = :sex and birth_date > :birth_date and birth_date < :birth_date2");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

    g.generateBy(gm.templateModel, gm.filePathModel);
  }
 
  public void test_select_with_cannot_guess_column_type() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select * from user_info where username = :username and password =:password and age = :age and sex = :sex and birth_date > :birth_date and birth_date < :birth_date2");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

    g.generateBy(gm.templateModel, gm.filePathModel);
  }
 
  public void test_select_same_params() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select * from user_info where username = :username and username like :username and birth_date between :birthDate and :birthDate");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

TOP

Related Classes of cn.org.rapid_framework.generator.Generator.GeneratorModel

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.