Skip to content

Commit 3bd3b6f

Browse files
committed
fix: entity设置了字段自动填充时生成代码报错的问题
1 parent dddef4f commit 3bd3b6f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/com/github/davidfantasy/mybatisplus/generatorui/mbp/MbpGenerator.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ private void configInjection(InjectionConfig.Builder builder, UserConfig userCon
160160
controllerMethodsVar.put("hasMethod", true);
161161
}
162162
vars.put("controllerMethods", controllerMethodsVar);
163-
if(!StrUtil.isEmpty(generatorConfig.getSchemaName())){
164-
vars.put("schemaName", generatorConfig.getSchemaName()+".");
163+
if (!StrUtil.isEmpty(generatorConfig.getSchemaName())) {
164+
vars.put("schemaName", generatorConfig.getSchemaName() + ".");
165165
}
166166
objectMap.putAll(vars);
167167
});
@@ -252,9 +252,11 @@ public String propertyNameConvert(@Nonnull TableField field) {
252252
&& !entityStrategy.getTableFills().isEmpty()) {
253253
List<IFill> tableFills = new ArrayList<>();
254254
for (String tableFillStr : entityStrategy.getTableFills()) {
255-
String[] tmp = tableFillStr.split(":");
256-
IFill tableFill = new Column(tmp[0], FieldFill.valueOf(tmp[1]));
257-
tableFills.add(tableFill);
255+
if (!StrUtil.isEmpty(tableFillStr)) {
256+
String[] tmp = tableFillStr.split(":");
257+
IFill tableFill = new Column(tmp[0], FieldFill.valueOf(tmp[1].toUpperCase()));
258+
tableFills.add(tableFill);
259+
}
258260
}
259261
entityBuilder.addTableFills(tableFills);
260262
}

0 commit comments

Comments
 (0)