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

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

The newest version!
package ${packageName}.db.mysql.entity

import nancal.mp.db.*
import nbcp.base.db.annotation.*
import nbcp.myoql.db.*
import nbcp.myoql.db.sql.annotation.*
import nbcp.myoql.db.sql.base.*
import nbcp.myoql.db.sql.define.*
import java.time.*

/**
* ${group}
* @author ${author}
*/

<#list entities as entity>
/**
* ${entity.getComment()}
* @author ${author}
*/
@DbEntityGroup("${entity.group}")
@Cn("${entity.getComment()}")
<#list entity.getColumns() as field>
<#if field.isPrimary()>
@DbEntityIndex("${field.getName()}", unique = true)

<#if field.getAutoId()>
@ConverterValueToDb("${field.getName()}", AutoIdConverter::class)
<#elseif field.getAutoNumber()>
@ConverterValueToDb("${field.getName()}", AutoNumberConverter::class)


@DbName("${entity.getName()}")
open class ${entity.getClassName()}(): ISqlDbEntity {
<#list entity.getColumns() as field>
    /**
    * ${field.getComment()}
    */
<#if field.getAutoInc()>
    @SqlAutoIncrementKey

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy