Package cn.org.rapid_framework.generator.Generator

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


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

  public void test_select_with_two_columns() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select sum(age) sum_age,count(username) cnt from user_info ");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here


  }
 
  public void test_select_count_and_multi_policy_one() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select count(username) cnt 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");
    selectSql.setMultiplicity(Sql.MULTIPLICITY_ONE);
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

  }
 
  public void test_select_string_and_multi_policy_one() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("select username 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");
    selectSql.setMultiplicity(Sql.MULTIPLICITY_ONE);
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

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

 
  public void test_delete_myisam_user_sql() throws Exception {
//    DataSourceProvider.getConnection().close();
//    GeneratorProperties.reload();
    Sql selectSql  = new SqlFactory().parseSql("delete 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_update_sql() throws Exception {
    Sql selectSql  = new SqlFactory().parseSql("update user_info set username = :username where password = :password and age=:age and sex=:sex");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
  }
View Full Code Here

  }

  public void test_insert_sql() throws Exception {
      try {
    Sql selectSql  = new SqlFactory().parseSql("insert into user_info values(:username,:password,:age,:sex,:userid,:blog)");
    GeneratorModel gm = newFromQuery(selectSql);
    g.generateBy(gm.templateModel, gm.filePathModel);
    fail("数据类型应该匹配不正确");
      }catch(Exception e) {
          e.printStackTrace();
      }
View Full Code Here

      }
  }

    public void test_insert_sql_with_right_name() throws Exception {
        Sql selectSql  = new SqlFactory().parseSql("insert into user_info values(:user_id,:username,:password,:birth_date,:sex,:age)");
        GeneratorModel gm = newFromQuery(selectSql);
        g.generateBy(gm.templateModel, gm.filePathModel);
    }
View Full Code Here

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

    public class ProcessUtils {
       
        public void processByGeneratorModel(GeneratorModel model,boolean isDelete) throws Exception, FileNotFoundException {
            Generator g = getGenerator();
           
            GeneratorModel targetModel = GeneratorModelUtils.newDefaultGeneratorModel();
            targetModel.filePathModel.putAll(model.filePathModel);
            targetModel.templateModel.putAll(model.templateModel);
            processByGeneratorModel(isDelete, g, targetModel);
        }
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.