templates.jdbc.business.hbs Maven / Gradle / Ivy
The newest version!
package {{config.packageName}}{{viewModifier}}.business;
{{> [header-comment.java]}}
import javax.sql.DataSource;
import {{config.packageName}}{{viewModifier}}.dal.{{pojoClassName}}List;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import javax.annotation.processing.Generated;
@Generated("com.github.yujiaao:tablegen")
@Repository
public class {{className}} extends {{pojoClassName}}List
{
{{! writeDALConstructor(tableName); }}
{{#if config.readWriteSeparate}}
/**
* @param readWrite master datasource for read & write
* @param readOnly slave datasource for read only
*/
public {{className}}(@Qualifier("{{config.alias}}") DataSource readWrite, @Qualifier("{{config.alias}}_r") DataSource readOnly)
{
super(readWrite,readOnly);
}{{else}}
/**
* @param ds datasource for injecting
*/
public {{className}}(@Qualifier("{{config.alias}}") DataSource ds)
{
super(ds);
}{{/if}}
// please write your code here!
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy