All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.entity.ftl Maven / Gradle / Ivy

package ${entityInfo.entityPackage};

<#list imports as pkg>
import ${pkg};

<#if entityConfig.isSwagger()>
    <#if generatorConfig.getSwaggerVersion() == 3>
import io.swagger.v3.oas.annotations.media.Schema;
    <#else>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
    


/**
 * 

* ${entityInfo.tableInfo.remarks!} *

* * @author ${author!} * @since ${date} */ <#if entityConfig.isLombok()> @Data @EqualsAndHashCode<#if entityConfig.getSuperClass()?? && entityConfig.getSuperClass() != ''>(callSuper = true) @ToString<#if entityConfig.getSuperClass()?? && entityConfig.getSuperClass() != ''>(callSuper = true) <#if entityConfig.isLombokBuilder()> <#if entityConfig.getSuperClass()?? && entityConfig.getSuperClass() != ''>@SuperBuilder<#else >@Builder @NoArgsConstructor <#if entityConfig.isSwagger()> <#if generatorConfig.getSwaggerVersion() == 3> @Schema(name = "${entityInfo.tableInfo.remarks!}") <#else> @ApiModel("${entityInfo.tableInfo.remarks!}") @Table(value="${entityInfo.tableInfo.name}"<#if entityConfig.isSchema()>,schema="${entityInfo.tableInfo.schema!}") public class ${entityInfo.name}${superExtend}<#if entityConfig.isSerial()> implements java.io.Serializable { <#if entityConfig.isSerial()> private static final long serialVersionUID = 1L; <#list entityInfo.fieldInfoList as field> <#if field.remarks?? && field.remarks != ""> /** * ${field.remarks!} */ <#if field.columnInfo.primaryKey> ${field.buildTableIdCode()!} <#if field.isNeedTableField(entityConfig)> ${field.buildTableField(entityConfig)} private ${field.typeName} ${field.name}; <#else> private ${field.typeName} ${field.name}; <#else> <#if field.columnInfo.isVersion()> @Version <#elseif field.columnInfo.isTenantId()> @TenantId <#elseif field.columnInfo.isLogicDelete()> ${entityConfig.getLogicDeleteCode()!} <#if entityConfig.isSwagger()> <#if generatorConfig.getSwaggerVersion() == 3> @Schema(description = "${field.remarks!}") <#else> @ApiModelProperty("${field.remarks!}") <#if field.isNeedTableField(entityConfig)> ${field.buildTableField(entityConfig)} private ${field.typeName} ${field.name}; <#else> private ${field.typeName} ${field.name}; <#if entityConfig.isLombok() == false> <#list entityInfo.fieldInfoList as field> public void ${field.setterMethodName()} (${field.typeName} ${field.name}) { this.${field.name} = ${field.name}; } public ${field.typeName} ${field.getterMethodName()} () { return this.${field.name}; } <#if !entityConfig.isLombok()> @Override public String toString() { return "${entityInfo.name}{" + <#list entityInfo.fieldInfoList as field> <#if field_index==0> "${field.name} = " + ${field.name} + <#else> ", ${field.name} = " + ${field.name} + "}"; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy