Przeglądaj źródła

代码生成时,entity增加了toString()方法

bj_renyong 8 lat temu
rodzic
commit
ec8dd57f31

+ 12 - 0
mybatis-plus/src/main/resources/templates/entity.java.vm

@@ -86,4 +86,16 @@ public class ${entity} implements Serializable {
 	}
 
 #end
+	@Override
+	public String toString() {
+		return "${entity}{" +
+#foreach($field in ${table.fields})
+#if($!{velocityCount}==1)
+			"${field.propertyName}=" + ${field.propertyName} +
+#else
+			", ${field.propertyName}=" + ${field.propertyName} +
+#end
+#end
+			"}";
+	}
 }