How can I convert mybatis setting to java base config
<p>Yeah, I mean pure java. I have my mybatis configed like this. Now most of my project is using java base config but mybatis.</p>

<pre><code>&lt;configuration&gt;
    &lt;settings&gt;
        &lt;setting name="cacheEnabled" value="true" /&gt;
        &lt;setting name="lazyLoadingEnabled" value="true" /&gt;
        &lt;setting name="multipleResultSetsEnabled" value="true" /&gt;
        &lt;setting name="useColumnLabel" value="true" /&gt;
        &lt;setting name="useGeneratedKeys" value="false" /&gt;
        ...
    &lt;/settings&gt;
&lt;/configuration&gt;
</code></pre>

<p>How can I config these in java file?
This below is my db config.</p>

<pre><code>@Configuration
@MapperScan("com.xxxx.basis.dao")
public class DBConfig {
    @Resource
    private Environment env;

    @Bean(destroyMethod = "close")
    public DruidDataSource dataSource() {
        DruidDataSource dataSource = new DruidDataSource();
        // ...
        return dataSource;
    }

    @Bean
    public DataSourceTransactionManager transactionManager() {
        return new DataSourceTransactionManager(dataSource());
    }

    @Bean
    public SqlSessionFactoryBean sqlSessionFactory() throws Exception {
        SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
        sessionFactory.setDataSource(dataSource());
        sessionFactory.setTypeAliasesPackage("com.xxx.basis.domain");
        return sessionFactory;
    }

}
</code></pre>