Explorar o código

Merge pull request #193 from Jkanon/master

修改kotlin生成实体类字段常量为静态变量(与java一致)
qmdx %!s(int64=7) %!d(string=hai) anos
pai
achega
defd4e6a1a

+ 6 - 1
mybatis-plus-generate/src/main/resources/templates/entity.kt.vm

@@ -65,11 +65,16 @@ class ${entity} : Serializable {
 
 
 #if(${entityColumnConstant})
+ 
+#if(${entityColumnConstant})
+    companion object {
 #foreach($field in ${table.fields})
 
-    val ${field.name.toUpperCase()} : String = "${field.name}"
+        const val ${field.name.toUpperCase()} : String = "${field.name}"
 
 #end
+    }
+
 #end
 #if(${activeRecord})
     override fun pkVal(): Serializable {