![JAR search and dependency download from the Maven repository](/logo.png)
com.blinkfox.zealotboot.ZealotAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zealot-spring-boot-starter Show documentation
Show all versions of zealot-spring-boot-starter Show documentation
Starter for using Zealot in Spring Boot generated dynamically SQL
The newest version!
package com.blinkfox.zealotboot;
import com.blinkfox.zealot.config.ZealotConfigManager;
import com.blinkfox.zealot.config.entity.NormalConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* Zealot自动配置类.
*
* @author blinkfox on 2018-05-02.
*/
@Configuration
@EnableConfigurationProperties(ZealotProperties.class)
public class ZealotAutoConfiguration {
/** ZealotProperties属性配置类的实例. */
private ZealotProperties properties;
/**
* 构造方法.
* @param properties Zealot的属性配置对象
*/
@Autowired
public ZealotAutoConfiguration(ZealotProperties properties) {
this.properties = properties;
this.doConfig();
}
/**
* 根据properties中的配置项做zealot的配置.
*/
private void doConfig() {
// 普通类型的配置
NormalConfig.getInstance()
.setDebug(this.properties.isDebug())
.setPrintBanner(this.properties.isPrintBanner())
.setPrintSqlInfo(this.properties.isPrintSql());
// 配置xml和handler扫描的路径.
ZealotConfigManager.getInstance()
.initLoadXmlLocations(this.properties.getXmlLocations())
.initLoadHandlerLocations(this.properties.getHandlerLocations());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy