mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
add comments for MybatisFlexBootstrap.java
This commit is contained in:
parent
cf1e677d82
commit
b8db87ab07
@ -39,13 +39,13 @@ import java.util.function.Function;
|
|||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* MybatisFlexBootstrap.getInstance()
|
* MybatisFlexBootstrap.getInstance()
|
||||||
* .setDatasource(...)
|
* .setDatasource(...)
|
||||||
* .addMapper(...)
|
* .addMapper(...)
|
||||||
* .start();
|
* .start();
|
||||||
* <p>
|
* <p>
|
||||||
* <p>
|
* <p>
|
||||||
* MybatisFlexBootstrap.getInstance()
|
* MybatisFlexBootstrap.getInstance()
|
||||||
* .execute(...)
|
* .execute(...)
|
||||||
* </code>
|
* </code>
|
||||||
*/
|
*/
|
||||||
public class MybatisFlexBootstrap {
|
public class MybatisFlexBootstrap {
|
||||||
@ -63,6 +63,12 @@ public class MybatisFlexBootstrap {
|
|||||||
private SqlSessionFactory sqlSessionFactory;
|
private SqlSessionFactory sqlSessionFactory;
|
||||||
private Class<? extends Log> logImpl;
|
private Class<? extends Log> logImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 虽然提供了 getInstance,但也允许自己进行实例化,可以用于创建多个 MybatisFlexBootstrap 达到管理数据源的目的
|
||||||
|
*/
|
||||||
|
public MybatisFlexBootstrap() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static volatile MybatisFlexBootstrap instance;
|
private static volatile MybatisFlexBootstrap instance;
|
||||||
|
|
||||||
@ -119,7 +125,6 @@ public class MybatisFlexBootstrap {
|
|||||||
mappers.forEach(configuration::addMapper);
|
mappers.forEach(configuration::addMapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LogFactory.getLog(MybatisFlexBootstrap.class).debug("Mybatis-Flex has started.");
|
LogFactory.getLog(MybatisFlexBootstrap.class).debug("Mybatis-Flex has started.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,6 +181,7 @@ public class MybatisFlexBootstrap {
|
|||||||
|
|
||||||
public MybatisFlexBootstrap setConfiguration(FlexConfiguration configuration) {
|
public MybatisFlexBootstrap setConfiguration(FlexConfiguration configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.environmentId = configuration.getEnvironment().getId();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user