package com.foreverwin.mesnac.console.mybatis.autoconfigure;

import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
import com.foreverwin.mesnac.console.mybatis.core.ExtMybatisConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

/**
 *
 * @description:
 * @author: syngna
 * @create: 2021-04-18 10:08
 */
@Primary
@ConditionalOnProperty(prefix = "mybatis-plus",name = "statement-lazy-load",havingValue = "true")
@Component
public class ExtMybatisPlusProperties extends MybatisPlusProperties {

    @NestedConfigurationProperty
    private ExtMybatisConfiguration configuration;

    @Override
    public ExtMybatisConfiguration getConfiguration() {
        return configuration;
    }

    public void setConfiguration(ExtMybatisConfiguration configuration) {
        this.configuration = configuration;
    }
}