public class ModelGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
baseModelPackageName |
protected Engine |
engine |
protected boolean |
generateDaoInModel |
protected String |
modelOutputDir |
protected String |
modelPackageName |
protected String |
template |
Constructor and Description |
---|
ModelGenerator(String modelPackageName,
String baseModelPackageName,
String modelOutputDir) |
Modifier and Type | Method and Description |
---|---|
void |
generate(List<TableMeta> tableMetas) |
protected void |
genModelContent(TableMeta tableMeta) |
protected void |
initEngine() |
void |
setGenerateDaoInModel(boolean generateDaoInModel) |
void |
setTemplate(String template)
使用自定义模板生成 model
|
protected void |
writeToFile(List<TableMeta> tableMetas) |
protected void |
writeToFile(TableMeta tableMeta)
若 model 文件存在,则不生成,以免覆盖用户手写的代码
|
protected Engine engine
protected String template
protected String modelPackageName
protected String baseModelPackageName
protected String modelOutputDir
protected boolean generateDaoInModel
protected void initEngine()
public void setTemplate(String template)
public void setGenerateDaoInModel(boolean generateDaoInModel)
protected void genModelContent(TableMeta tableMeta)
protected void writeToFile(TableMeta tableMeta) throws IOException
IOException
Copyright © 2018. All rights reserved.