Skip to content

Commit 3f3f8ef

Browse files
committed
支持指定多表生成
1 parent 49affeb commit 3f3f8ef

File tree

1 file changed

+11
-1
lines changed
  • api-boot-project/api-boot-maven-plugins/api-boot-mybatis-enhance-maven-codegen/src/main/java/org/minbox/framework/api/boot/maven/plugin/mybatis/enhance/codegen

1 file changed

+11
-1
lines changed

api-boot-project/api-boot-maven-plugins/api-boot-mybatis-enhance-maven-codegen/src/main/java/org/minbox/framework/api/boot/maven/plugin/mybatis/enhance/codegen/ApiBootMybatisEnhanceCodegen.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ public class ApiBootMybatisEnhanceCodegen extends AbstractMojo {
107107
*/
108108
@Parameter(defaultValue = "%")
109109
private String tableNamePattern;
110+
/**
111+
* Specify the list of generated tables
112+
* for example:
113+
* <tables>
114+
* <table>sys_menu_info</table>
115+
* <table>sys_role_info</table>
116+
* </tables>
117+
*/
118+
@Parameter
119+
private List<String> tables;
110120
/**
111121
* project base dir
112122
*/
@@ -146,7 +156,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
146156
// get database instance by DbTypeEnum
147157
DataBase dataBase = DataBaseFactory.newInstance(codeBuilderProperties);
148158

149-
List<String> tableNames = getTableNames(dataBase);
159+
List<String> tableNames = ObjectUtils.isEmpty(tables) ? getTableNames(dataBase) : tables;
150160

151161
tableNames.stream().forEach(tableName -> {
152162

0 commit comments

Comments
 (0)