Skip to content

Commit

Permalink
修复强制生成字段注解的配置无法生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfantasy committed Apr 17, 2021
1 parent 287e658 commit 8af78d9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ private void genCode(AutoGenerator ag, GenSetting genSetting, UserConfig userCon
focList.add(new FileOutConfig(outputFileInfo.getAvailableTemplatePath()) {
@Override
public String outputFile(TableInfo tableInfo) {
//避免使用了NameConverter导致entityTableFieldAnnotationEnable属性失效的问题,在此强制进行设置
if (userConfig.getEntityStrategy().isEntityTableFieldAnnotationEnable()) {
tableInfo.getFields().forEach(field -> {
field.setConvert(true);
});
tableInfo.getImportPackages().add("com.baomidou.mybatisplus.annotation.TableField");
}
return filePath;
}
});
Expand Down

0 comments on commit 8af78d9

Please sign in to comment.