public class TemplateGenerator extends Object implements IGlobalConfig, ITableConfig
| 限定符和类型 | 字段和说明 |
|---|---|
protected GlobalConfig |
globalConfig
全局配置
|
protected TableConfigSet |
tableConfigs |
protected static boolean |
withEntity
生成entity文件
|
static boolean |
withTest
生成test辅助文件
全局开放设置, 方便多个设置时, 最后生成ATM汇总文件
|
| 构造器和说明 |
|---|
TemplateGenerator() |
| 限定符和类型 | 方法和说明 |
|---|---|
static IGlobalConfig |
build(boolean withEntity,
boolean withTest) |
void |
execute()
执行代码生成
|
static void |
generateSummary()
生成汇总文件
|
ITableConfig |
globalConfig(Consumer<GlobalConfig> consumer)
设置生成的全局配置
|
ITableConfig |
relations(Consumer<TableConfigSet> consumer)
设置表关联关系
|
static void |
setBasePackage(String _package) |
static void |
setGlobalTestDir(String dir) |
ITableConfig |
tables(Consumer<ITableConfigSet> consumer)
设置要生成的表
|
ITableConfig |
tables(ITableConfigSet... tableConfigs) |
public static boolean withTest
protected static boolean withEntity
protected TableConfigSet tableConfigs
protected GlobalConfig globalConfig
public static IGlobalConfig build(boolean withEntity, boolean withTest)
public ITableConfig globalConfig(Consumer<GlobalConfig> consumer)
IGlobalConfigglobalConfig 在接口中 IGlobalConfigconsumer - config consumerpublic ITableConfig tables(Consumer<ITableConfigSet> consumer)
ITableConfigtables 在接口中 ITableConfigconsumer - Consumerpublic ITableConfig relations(Consumer<TableConfigSet> consumer)
ITableConfigrelations 在接口中 ITableConfigconsumer - Consumerpublic ITableConfig tables(ITableConfigSet... tableConfigs)
public void execute()
execute 在接口中 ITableConfigpublic static void setBasePackage(String _package)
public static void setGlobalTestDir(String dir)
public static void generateSummary()
Copyright © 2021. All rights reserved.