com.github.zhengframework.mybatis.MyBatisXmlInternalModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zheng-mybatis Show documentation
Show all versions of zheng-mybatis Show documentation
zheng framework module: mybatis support
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);
}
}