Преглед на файлове

fixed github issues/476 issues/473

hubin преди 6 години
родител
ревизия
bf956bcb02

+ 2 - 1
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/builder/ConfigBuilder.java

@@ -345,7 +345,8 @@ public class ConfigBuilder {
         for (TableInfo tableInfo : tableList) {
             String entityName = NamingStrategy.capitalFirst(processName(tableInfo.getName(), strategy, tablePrefix));
             if (StringUtils.isNotEmpty(globalConfig.getEntityName())) {
-                tableInfo.setEntityName(strategyConfig, String.format(globalConfig.getEntityName(), entityName));
+                tableInfo.setConvert(true);
+                tableInfo.setEntityName(String.format(globalConfig.getEntityName(), entityName));
             } else {
                 tableInfo.setEntityName(strategyConfig, entityName);
             }

+ 4 - 0
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/po/TableInfo.java

@@ -108,6 +108,10 @@ public class TableInfo {
         return entityName;
     }
 
+    public void setEntityName(String entityName) {
+        this.entityName = entityName;
+    }
+
     public void setEntityName(StrategyConfig strategyConfig, String entityName) {
         this.entityName = entityName;
         this.setConvert(strategyConfig);