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

templates.dao.impl.ftl Maven / Gradle / Ivy

package ${entityInfo.daoImplPackage};

<#list imports as pkg>
import ${pkg};


/**
 * 

* ${entityInfo.tableInfo.remarks!} Dao 实现类 *

* * @author ${author!} * @since ${date} */ @${repositoryAnnotationName} public class ${entityInfo.daoImplName} ${superExtend}<#if daoConfig.isGeneric()><${entityInfo.name},<#if entityInfo.idFieldInfo??>${entityInfo.idFieldInfo.typeName}<#else>Void> <#if daoConfig.isEnable()>implements ${entityInfo.daoName}{ <#if containerType.is("solon")> @${autowiredAnnotationName} private ${entityInfo.mapperName} ${util.firstToLower(entityInfo.mapperName)}; @Init public void init(){ this.setMapper(${util.firstToLower(entityInfo.mapperName)}); } @Override protected ${entityInfo.mapperName} getMapper(){ return this.${util.firstToLower(entityInfo.mapperName)}; } <#else> @${autowiredAnnotationName} public ${entityInfo.daoImplName} (${entityInfo.mapperName} ${util.firstToLower(entityInfo.mapperName)}){ super(${util.firstToLower(entityInfo.mapperName)}); } @Override protected ${entityInfo.mapperName} getMapper(){ return (${entityInfo.mapperName}) this.mapper; } <#if entityInfo.hasMultiId()> @Override public ${entityInfo.name} getById(<#list entityInfo.idFieldInfoList as field>${field.typeName} ${field.name}<#if field_has_next>, ){ return getMapper().getById(<#list entityInfo.idFieldInfoList as field>${field.name}<#if field_has_next>, ); } protected int deleteById(<#list entityInfo.idFieldInfoList as field>${field.typeName} ${field.name}<#if field_has_next>, ){ return getMapper().deleteById(<#list entityInfo.idFieldInfoList as field>${field.name}<#if field_has_next>, ); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy