Extremely fast experience Generator


JFinal 2.1 adds a new Generator to quickly generate Model, BaseModel, MappingKit, and DataDictionary files. When using it, you usually only need to configure four parameters of the Generator: baseModelPackageName, baseModelOutputDir, modelPackageName, modelOutputDir. The four parameters respectively represent the package name of baseMode, the output path of baseModel, the package name of model, and the output path of model. The following is the sample code:

// base model 所使用的包名
String baseModelPkg = "model.base";
// base model 文件保存路径
String baseModelDir = PathKit.getWebRootPath() + "/../src/model/base";
 
// model 所使用的包名
String modelPkg = "model";
// model 文件保存路径
String modelDir = baseModelDir+ "/..";
 
Generator gernerator = new Generator(dataSource, baseModelPkg, baseModelDir,modelPkg, modelDir);
gernerator.generate();


can be found on the JFinal official website Download the source code to use directly in the project: http://www.jfinal.com