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

myoql-template.mysql.jpa-entity.ftl Maven / Gradle / Ivy

The newest version!
package ${packageName}

import nbcp.myoql.db.*
import nbcp.db.sql.*
import nbcp.db.mysql.*
import java.time.*

/**
* ${entity.getComment()}
* @author ${author}
*/
@DbEntityGroup("${entity.group}")
@Cn("${entity.getComment()}")
@DbUks(${entity.getUks()?join(",")})
@DbName("${entity.getName()}")
open class ${entity.getClassName()}(): ISqlDbEntity {
<#list entity.getColumns() as field>
    /**
    * ${field.getComment()}
    */
<#if  field.getAutoInc()>
    @SqlAutoIncrementKey
<#elseif field.getAutoId()>
    @ConverterValueToDb(AutoIdConverter::class)
<#elseif field.getAutoNumber()>
    @ConverterValueToDb(AutoNumberConverter::class)

    @Cn("${field.getComment()}")
    @DbName("${field.getName()}")
    var ${field.getFieldName()}: ${field.getKotlinType()} = ${field.getKotlinDefaultValue()}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy