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

generate.domain.ftl Maven / Gradle / Ivy

package ${configuration.domainPackage};
import javax.persistence.*;
<#if hasLombok>
import lombok.Getter;
import lombok.Setter;

<#if baseEntityPkg>
import ${baseEntityPkg};

<#list importList as importclazz>
import ${importclazz};

import com.efeichong.audit.InsertDefault;

/**
* @author ${configuration.author}
* @date ${configuration.dateTime}
* @description ${tableComment}
*/
<#if hasLombok>
@Setter
@Getter

@Entity(name = "${tableName}")
<#if tableIndex??>
${tableIndex}

<#if logicDelete??>
${logicDelete}

public class ${javaName} <#if baseEntityName?? >extends ${baseEntityName}{
<#list tableColumns as column>
    <#if column.columnComment?length gt 0>
    /**${column.columnComment}**/
    
    <#if column.joinTable??>
    ${column.joinTable}
    
    <#if column.mappedType??>
    ${column.mappedType}
    
    <#if column.columnAnn>
    ${column.columnAnn}
    
    <#if column.hasPrimaryKey==1>
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    
    <#if column.columnDefault?length gt 0>
    @InsertDefault("${column.columnDefault}")
    
    private ${column.fieldType} ${column.fieldName};



<#if !hasLombok>
<#list tableColumns as column>
    public ${column.fieldType} get${column.firstUpperFieldName}(){
    return ${column.fieldName};
    }

    public void set${column.firstUpperFieldName}(${column.fieldType} ${column.fieldName}){
    this.${column.fieldName} = ${column.fieldName};
    }





}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy