template.entity.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of luna-code-gen Show documentation
Show all versions of luna-code-gen Show documentation
自动生成dao entity service,程序引入时候maven scope选择test
The newest version!
package com.seezoon.modules.${moduleName}.entity;
import com.seezoon.luna.entity.BaseEntity;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
<#if hasBigDecimal >
import java.math.BigDecimal;
#if>
<#if hasDate >
import java.util.Date;
#if>
/**
* ${tableComment!}
* Copyright © 2018 powered by huangdf, All rights reserved.
* @author hdf ${.now}
*/
public class ${className} extends BaseEntity<${pkJavaType}> {
private static final long serialVersionUID = 1L;
<#list columns as columnInfo>
<#if columnInfo.javaFieldName != "id" && columnInfo.javaFieldName != "createBy" && columnInfo.javaFieldName != "createDate" && columnInfo.javaFieldName != "updateBy" && columnInfo.javaFieldName != "updateDate" && columnInfo.javaFieldName != "remarks">
/**
* ${columnInfo.comment}
*/
<#if columnInfo.nullable! != "1">
@NotNull
<#if columnInfo.javaType == "String">
@Length(min = 1, max = ${columnInfo.maxlength?c!255})
#if>
<#else>
<#if columnInfo.javaType == "String">
@Length(max = ${columnInfo.maxlength?c!255})
#if>
#if>
private ${columnInfo.javaType} ${columnInfo.javaFieldName};
#if>
#list>
<#list columns as columnInfo>
<#if columnInfo.javaFieldName != "id" && columnInfo.javaFieldName != "createBy" && columnInfo.javaFieldName != "createDate" && columnInfo.javaFieldName != "updateBy" && columnInfo.javaFieldName != "updateDate" && columnInfo.javaFieldName != "remarks">
public ${columnInfo.javaType} get${columnInfo.javaFieldName ? cap_first}(){
return ${columnInfo.javaFieldName};
}
public void set${columnInfo.javaFieldName ? cap_first}(${columnInfo.javaType} ${columnInfo.javaFieldName}){
this.${columnInfo.javaFieldName} = ${columnInfo.javaFieldName};
}
#if>
#list>
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy