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

templates.entity.ftl Maven / Gradle / Ivy

The newest version!
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;
    


<#if entityConfig.isComment()>
/**
<#if entityInfo.tableInfo.remarks?? && entityInfo.tableInfo.remarks != "">
 * 

* ${entityInfo.tableInfo.remarks!} *

* * @author ${author!} * @since ${date} */ <#if entityConfig.isLombok()> @Data <#if entityConfig.isLombokBuilder()> <#if entityConfig.hasSuperClass()> @SuperBuilder <#else> @Builder @NoArgsConstructor <#if entityConfig.hasSuperClass()> @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) <#if entityConfig.isSwagger() && entityInfo.tableInfo.remarks?? && entityInfo.tableInfo.remarks != ""> <#if generatorConfig.getSwaggerVersion() == 3> @Schema(name = "${entityInfo.tableInfo.remarks!}") <#else> @ApiModel("${entityInfo.tableInfo.remarks!}") ${entityInfo.buildTable(entityConfig)} public class ${entityInfo.buildClassFullName(entityConfig)} { <#if entityConfig.isSerial()> private static final long serialVersionUID = 1L; <#list entityInfo.fieldInfoList as field> <#if entityConfig.isComment() && field.remarks?? && field.remarks != ""> /** * ${field.remarks!} */ <#if field.columnInfo.primaryKey> <#if entityConfig.isSwagger() && field.remarks?? && field.remarks != ""> <#if generatorConfig.getSwaggerVersion() == 3> @Schema(description = "${field.remarks!}") <#else> @ApiModelProperty("${field.remarks!}") ${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() && field.remarks?? && field.remarks != ""> <#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}{" + <#if entityConfig.hasSuperClass()> " super = " +super.toString() + <#list entityInfo.fieldInfoList as field> <#if field_index==0> <#if entityConfig.hasSuperClass()>", <#else >"${field.name} = " + ${field.name} + <#else> ", ${field.name} = " + ${field.name} + "}"; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy