![JAR search and dependency download from the Maven repository](/logo.png)
myoql-template.mysql.mysql-myoql-entity.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktmyoql-code-generator Show documentation
Show all versions of ktmyoql-code-generator Show documentation
kotlin orm -- mysql,mongo , just like ktorm
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>
<#if field.getAutoId()>
@ConverterValueToDb("${field.getName()}", AutoIdConverter::class)
<#elseif field.getAutoNumber()>
@ConverterValueToDb("${field.getName()}", AutoNumberConverter::class)
#if>
#list>
@DbName("${entity.getName()}")
open class ${entity.getClassName()}(): ISqlDbEntity {
<#list entity.getColumns() as field>
/**
* ${field.getComment()}
*/
<#if field.getAutoInc()>
@SqlAutoIncrementKey
#if>
@Cn("${field.getComment()}")
@DbName("${field.getName()}")
var ${field.getFieldName()}: ${field.getKotlinType()} = ${field.getKotlinDefaultValue()}
#list>
}
#list>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy