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

com.github.zhengframework.mybatis.MyBatisXmlInternalModule Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
package com.github.zhengframework.mybatis;

import java.util.Objects;
import java.util.Properties;
import org.mybatis.guice.XMLMyBatisModule;

public class MyBatisXmlInternalModule extends XMLMyBatisModule {

  private final MyBatisConfig myBatisConfig;

  public MyBatisXmlInternalModule(MyBatisConfig myBatisConfig) {
    this.myBatisConfig = myBatisConfig;
  }

  @Override
  protected void initialize() {
    setClassPathResource(Objects.requireNonNull(myBatisConfig.getConfigFile()));
    Properties properties = new Properties();
    properties.putAll(myBatisConfig.getProperties());
    addProperties(properties);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy