Skip to content

Commit e84fd27

Browse files
authored
Merge pull request moshowgame#18 from h2so/master
为实体类生成添加显式的默认构造方法
2 parents 6fb2cba + f65fdca commit e84fd27

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

generator-web/src/main/resources/templates/xxl-code-generator/beetlentity.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public class ${classInfo.className} implements Serializable {
1919
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
2020

2121
</#list>
22+
public ${classInfo.className}() {
23+
}
2224
</#if>
2325

2426
}

generator-web/src/main/resources/templates/xxl-code-generator/entity.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public class ${classInfo.className} implements Serializable {
2323
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
2424

2525
</#list>
26+
public ${classInfo.className}() {
27+
}
2628
</#if>
2729

2830
}

generator-web/src/main/resources/templates/xxl-code-generator/model.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public class ${classInfo.className} implements Serializable {
2020
</#if>
2121

2222
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
23+
public ${classInfo.className}() {
24+
}
25+
2326
<#list classInfo.fieldList as fieldItem>
2427
public ${fieldItem.fieldClass} get${fieldItem.fieldName?cap_first}() {
2528
return ${fieldItem.fieldName};

0 commit comments

Comments
 (0)