|
@@ -233,7 +233,7 @@ public class GlobalConfiguration implements Cloneable, Serializable {
|
|
*/
|
|
*/
|
|
public static SqlSessionFactory currentSessionFactory(Class<?> clazz) {
|
|
public static SqlSessionFactory currentSessionFactory(Class<?> clazz) {
|
|
String configMark = TableInfoHelper.getTableInfo(clazz).getConfigMark();
|
|
String configMark = TableInfoHelper.getTableInfo(clazz).getConfigMark();
|
|
- GlobalConfiguration mybatisGlobalConfig = GlobalConfiguration.GlobalConfig(configMark);
|
|
|
|
|
|
+ GlobalConfiguration mybatisGlobalConfig = GlobalConfiguration.getGlobalConfig(configMark);
|
|
return mybatisGlobalConfig.getSqlSessionFactory();
|
|
return mybatisGlobalConfig.getSqlSessionFactory();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -290,11 +290,11 @@ public class GlobalConfiguration implements Cloneable, Serializable {
|
|
* @param configuration
|
|
* @param configuration
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public static GlobalConfiguration GlobalConfig(Configuration configuration) {
|
|
|
|
|
|
+ public static GlobalConfiguration getGlobalConfig(Configuration configuration) {
|
|
if (configuration == null) {
|
|
if (configuration == null) {
|
|
throw new MybatisPlusException("Error: You need Initialize MybatisConfiguration !");
|
|
throw new MybatisPlusException("Error: You need Initialize MybatisConfiguration !");
|
|
}
|
|
}
|
|
- return GlobalConfig(configuration.toString());
|
|
|
|
|
|
+ return getGlobalConfig(configuration.toString());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -303,7 +303,7 @@ public class GlobalConfiguration implements Cloneable, Serializable {
|
|
* @param configMark
|
|
* @param configMark
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public static GlobalConfiguration GlobalConfig(String configMark) {
|
|
|
|
|
|
+ public static GlobalConfiguration getGlobalConfig(String configMark) {
|
|
GlobalConfiguration cache = GLOBAL_CONFIG.get(configMark);
|
|
GlobalConfiguration cache = GLOBAL_CONFIG.get(configMark);
|
|
if (cache == null) {
|
|
if (cache == null) {
|
|
// 没有获取全局配置初始全局配置
|
|
// 没有获取全局配置初始全局配置
|
|
@@ -315,20 +315,20 @@ public class GlobalConfiguration implements Cloneable, Serializable {
|
|
}
|
|
}
|
|
|
|
|
|
public static DBType getDbType(Configuration configuration) {
|
|
public static DBType getDbType(Configuration configuration) {
|
|
- return GlobalConfig(configuration).getDbType();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).getDbType();
|
|
}
|
|
}
|
|
|
|
|
|
public static IdType getIdType(Configuration configuration) {
|
|
public static IdType getIdType(Configuration configuration) {
|
|
- return GlobalConfig(configuration).getIdType();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).getIdType();
|
|
}
|
|
}
|
|
|
|
|
|
public static boolean isDbColumnUnderline(Configuration configuration) {
|
|
public static boolean isDbColumnUnderline(Configuration configuration) {
|
|
- return GlobalConfig(configuration).isDbColumnUnderline();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).isDbColumnUnderline();
|
|
}
|
|
}
|
|
|
|
|
|
public static ISqlInjector getSqlInjector(Configuration configuration) {
|
|
public static ISqlInjector getSqlInjector(Configuration configuration) {
|
|
// fix #140
|
|
// fix #140
|
|
- GlobalConfiguration globalConfiguration = GlobalConfig(configuration);
|
|
|
|
|
|
+ GlobalConfiguration globalConfiguration = getGlobalConfig(configuration);
|
|
ISqlInjector sqlInjector = globalConfiguration.getSqlInjector();
|
|
ISqlInjector sqlInjector = globalConfiguration.getSqlInjector();
|
|
if (sqlInjector == null) {
|
|
if (sqlInjector == null) {
|
|
sqlInjector = new AutoSqlInjector();
|
|
sqlInjector = new AutoSqlInjector();
|
|
@@ -338,35 +338,35 @@ public class GlobalConfiguration implements Cloneable, Serializable {
|
|
}
|
|
}
|
|
|
|
|
|
public static IMetaObjectHandler getMetaObjectHandler(Configuration configuration) {
|
|
public static IMetaObjectHandler getMetaObjectHandler(Configuration configuration) {
|
|
- return GlobalConfig(configuration).getMetaObjectHandler();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).getMetaObjectHandler();
|
|
}
|
|
}
|
|
|
|
|
|
public static FieldStrategy getFieldStrategy(Configuration configuration) {
|
|
public static FieldStrategy getFieldStrategy(Configuration configuration) {
|
|
- return GlobalConfig(configuration).getFieldStrategy();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).getFieldStrategy();
|
|
}
|
|
}
|
|
|
|
|
|
public static boolean isRefresh(Configuration configuration) {
|
|
public static boolean isRefresh(Configuration configuration) {
|
|
- return GlobalConfig(configuration).isRefresh();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).isRefresh();
|
|
}
|
|
}
|
|
|
|
|
|
public static boolean isAutoSetDbType(Configuration configuration) {
|
|
public static boolean isAutoSetDbType(Configuration configuration) {
|
|
- return GlobalConfig(configuration).isAutoSetDbType();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).isAutoSetDbType();
|
|
}
|
|
}
|
|
|
|
|
|
public static Set<String> getMapperRegistryCache(Configuration configuration) {
|
|
public static Set<String> getMapperRegistryCache(Configuration configuration) {
|
|
- return GlobalConfig(configuration).getMapperRegistryCache();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).getMapperRegistryCache();
|
|
}
|
|
}
|
|
|
|
|
|
public static String getIdentifierQuote(Configuration configuration) {
|
|
public static String getIdentifierQuote(Configuration configuration) {
|
|
- return GlobalConfig(configuration).getIdentifierQuote();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).getIdentifierQuote();
|
|
}
|
|
}
|
|
|
|
|
|
public static SqlSession getSqlSession(Configuration configuration) {
|
|
public static SqlSession getSqlSession(Configuration configuration) {
|
|
- return GlobalConfig(configuration).getSqlSession();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).getSqlSession();
|
|
}
|
|
}
|
|
|
|
|
|
public static SqlSession getSqlsessionBatch(Configuration configuration) {
|
|
public static SqlSession getSqlsessionBatch(Configuration configuration) {
|
|
- return GlobalConfig(configuration).getSqlsessionBatch();
|
|
|
|
|
|
+ return getGlobalConfig(configuration).getSqlsessionBatch();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|