Selaa lähdekoodia

fixed gitee pr 38

= 7 vuotta sitten
vanhempi
commit
12586c5757

+ 4 - 4
src/main/java/com/baomidou/mybatisplus/generator/config/StrategyConfig.java

@@ -206,7 +206,7 @@ public class StrategyConfig {
         return tablePrefix;
     }
 
-    public StrategyConfig setTablePrefix(String[] tablePrefix) {
+    public StrategyConfig setTablePrefix(String... tablePrefix) {
         this.tablePrefix = tablePrefix;
         return this;
     }
@@ -235,7 +235,7 @@ public class StrategyConfig {
         return superEntityColumns;
     }
 
-    public StrategyConfig setSuperEntityColumns(String[] superEntityColumns) {
+    public StrategyConfig setSuperEntityColumns(String... superEntityColumns) {
         this.superEntityColumns = superEntityColumns;
         return this;
     }
@@ -280,7 +280,7 @@ public class StrategyConfig {
         return include;
     }
 
-    public StrategyConfig setInclude(String[] include) {
+    public StrategyConfig setInclude(String... include) {
         this.include = include;
         return this;
     }
@@ -289,7 +289,7 @@ public class StrategyConfig {
         return exclude;
     }
 
-    public StrategyConfig setExclude(String[] exclude) {
+    public StrategyConfig setExclude(String... exclude) {
         this.exclude = exclude;
         return this;
     }

+ 1 - 0
src/main/resources/templates/entity.java.vm

@@ -12,6 +12,7 @@ import ${pkg};
 import com.baomidou.mybatisplus.annotations.Version;
 
 import lombok.Data;
+import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 #end
 

+ 9 - 9
src/main/resources/templates/mapper.xml.vm

@@ -3,34 +3,34 @@
 <mapper namespace="${package.Mapper}.${table.mapperName}">
 
 #if(${enableCache})
-	<!-- 开启二级缓存 -->
-	<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
+    <!-- 开启二级缓存 -->
+    <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
 
 #end
 #if(${baseResultMap})
-	<!-- 通用查询映射结果 -->
-	<resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
 #foreach($field in ${table.fields})
 #if(${field.keyFlag})##生成主键排在第一位
-		<id column="${field.name}" property="${field.propertyName}" />
+        <id column="${field.name}" property="${field.propertyName}" />
 #end
 #end
 #foreach($field in ${table.commonFields})##生成公共字段
-	<result column="${field.name}" property="${field.propertyName}" />
+    <result column="${field.name}" property="${field.propertyName}" />
 #end
 #foreach($field in ${table.fields})
 #if(!${field.keyFlag})##生成普通字段
-		<result column="${field.name}" property="${field.propertyName}" />
+        <result column="${field.name}" property="${field.propertyName}" />
 #end
 #end
-	</resultMap>
+    </resultMap>
 
 #end
 #if(${baseColumnList})
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
 #foreach($field in ${table.commonFields})
-	#if(${field.name} == ${field.propertyName})${field.name}#else${field.name} AS ${field.propertyName}#end,
+    #if(${field.name} == ${field.propertyName})${field.name}#else${field.name} AS ${field.propertyName}#end,
 #end
         ${table.fieldNames}
     </sql>