Browse Source

修改kotlin生成字段常量为静态变量(与java一直)

Jkanon 7 years ago
parent
commit
9d60181c0d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      mybatis-plus-generate/src/main/resources/templates/entity.kt.vm

+ 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 {