public void processByClass(Class clazz, boolean isDelete) throws Exception, FileNotFoundException { Generator g = getGenerator(); GeneratorModel m = GeneratorModelUtils.newGeneratorModel("clazz", new JavaClass(clazz)); PrintUtils.printBeginProcess("JavaClass:" + clazz.getSimpleName(), isDelete); processByGeneratorModel(isDelete, g, m); }
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); }
public void processByTable(Generator g, Table table, boolean isDelete) throws Exception { GeneratorModel m = GeneratorModelUtils.newGeneratorModel("table", table); PrintUtils.printBeginProcess(table.getSqlName() + " => " + table.getClassName(), isDelete); if (isDelete) g.deleteBy(m.templateModel, m.filePathModel); else g.generateBy(m.templateModel, m.filePathModel); }
public void processBySql(Sql sql, boolean isDelete) throws Exception { Generator g = getGenerator(); GeneratorModel m = GeneratorModelUtils.newGeneratorModel("sql", sql); PrintUtils.printBeginProcess("sql:" + sql.getSourceSql(), isDelete); processByGeneratorModel(isDelete, g, m); }
public void processByMap(Map params, boolean isDelete) throws Exception, FileNotFoundException { Generator g = getGenerator(); GeneratorModel m = GeneratorModelUtils.newFromMap(params); processByGeneratorModel(isDelete, g, m); }