mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2026-06-24 16:07:45 +08:00
48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
|
<#list classInfo.fieldList as fieldItem >
|
|
<#if fieldItem.fieldClass == "Date">
|
|
<#assign importDdate = true />
|
|
</#if>
|
|
</#list>
|
|
</#if>
|
|
import java.io.Serializable;
|
|
import javax.persistence.*;
|
|
import lombok.Data;
|
|
<#if importDdate>
|
|
import java.util.Date;
|
|
</#if>
|
|
|
|
/**
|
|
* ${classInfo.classComment}
|
|
*
|
|
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
|
*/
|
|
@Entity
|
|
@Data
|
|
@Table(name="${classInfo.tableName}")
|
|
public class ${classInfo.className} implements Serializable {
|
|
private static final long serialVersionUID = 42L;
|
|
|
|
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
|
<#list classInfo.fieldList as fieldItem >
|
|
/**
|
|
* ${fieldItem.fieldComment}
|
|
*/
|
|
private ${fieldItem.fieldClass} ${fieldItem.fieldName};
|
|
|
|
</#list>
|
|
</#if>
|
|
|
|
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
|
<#list classInfo.fieldList as fieldItem>
|
|
public ${fieldItem.fieldClass} get${fieldItem.fieldName?cap_first}() {
|
|
return ${fieldItem.fieldName};
|
|
}
|
|
|
|
public void set${fieldItem.fieldName?cap_first}(${fieldItem.fieldClass} ${fieldItem.fieldName}) {
|
|
this.${fieldItem.fieldName} = ${fieldItem.fieldName};
|
|
}
|
|
|
|
</#list>
|
|
</#if>
|
|
} |