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

pro.shuangxi.devTool.mybatis.MybatisDevToolAutoConfig Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
package pro.shuangxi.devTool.mybatis;

import javax.servlet.http.HttpServletRequest;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import pro.shuangxi.devTool.DevToolProperties;

/**
 * @author mengshx
 **/
@Configuration
@ConditionalOnClass(SqlSessionFactory.class)
public class MybatisDevToolAutoConfig {

    public MybatisDevToolAutoConfig() {
        System.out.println("MybatisDevToolAutoConfig");
    }

    @Bean
    @Order(Ordered.LOWEST_PRECEDENCE)
    @ConditionalOnProperty(name = "dev-tool.mybatis.open-log", havingValue = "true",matchIfMissing = true)
    public MyBatisSqlInterceptor myBatisSqlInterceptor(MybatisDevToolProperties properties) {
        MyBatisSqlInterceptor interceptor = new MyBatisSqlInterceptor();
        return interceptor;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy