|
@@ -18,6 +18,7 @@ package com.baomidou.mybatisplus.autoconfigure;
|
|
|
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
|
|
import com.baomidou.mybatisplus.core.config.GlobalConfig;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
|
|
|
+import lombok.Data;
|
|
|
import org.apache.ibatis.session.ExecutorType;
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
|
@@ -36,6 +37,7 @@ import java.util.stream.Stream;
|
|
|
* @author Eddú Meléndez
|
|
|
* @author Kazuki Shimizu
|
|
|
*/
|
|
|
+@Data
|
|
|
@ConfigurationProperties(prefix = MybatisPlusProperties.MYBATIS_PREFIX)
|
|
|
public class MybatisPlusProperties {
|
|
|
|
|
@@ -69,11 +71,6 @@ public class MybatisPlusProperties {
|
|
|
*/
|
|
|
private String typeHandlersPackage;
|
|
|
|
|
|
- /**
|
|
|
- * 枚举包扫描
|
|
|
- */
|
|
|
- private String typeEnumsPackage;
|
|
|
-
|
|
|
/**
|
|
|
* Indicates whether perform presence check of the MyBatis xml config file.
|
|
|
*/
|
|
@@ -92,121 +89,22 @@ public class MybatisPlusProperties {
|
|
|
/**
|
|
|
* A Configuration object for customize default settings. If {@link #configLocation}
|
|
|
* is specified, this property is not used.
|
|
|
+ * TODO 使用 MybatisConfiguration
|
|
|
*/
|
|
|
@NestedConfigurationProperty
|
|
|
private MybatisConfiguration configuration;
|
|
|
|
|
|
/**
|
|
|
- * 全局配置
|
|
|
- */
|
|
|
- @NestedConfigurationProperty
|
|
|
- private GlobalConfig globalConfig = GlobalConfigUtils.defaults();
|
|
|
-
|
|
|
- /**
|
|
|
- * @since 1.1.0
|
|
|
- */
|
|
|
- public String getConfigLocation() {
|
|
|
- return this.configLocation;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @since 1.1.0
|
|
|
+ * TODO 枚举包扫描
|
|
|
*/
|
|
|
- public void setConfigLocation(String configLocation) {
|
|
|
- this.configLocation = configLocation;
|
|
|
- }
|
|
|
-
|
|
|
- public String[] getMapperLocations() {
|
|
|
- return this.mapperLocations;
|
|
|
- }
|
|
|
-
|
|
|
- public void setMapperLocations(String[] mapperLocations) {
|
|
|
- this.mapperLocations = mapperLocations;
|
|
|
- }
|
|
|
-
|
|
|
- public String getTypeHandlersPackage() {
|
|
|
- return this.typeHandlersPackage;
|
|
|
- }
|
|
|
-
|
|
|
- public void setTypeHandlersPackage(String typeHandlersPackage) {
|
|
|
- this.typeHandlersPackage = typeHandlersPackage;
|
|
|
- }
|
|
|
-
|
|
|
- public String getTypeEnumsPackage() {
|
|
|
- return typeEnumsPackage;
|
|
|
- }
|
|
|
-
|
|
|
- public void setTypeEnumsPackage(String typeEnumsPackage) {
|
|
|
- this.typeEnumsPackage = typeEnumsPackage;
|
|
|
- }
|
|
|
-
|
|
|
- public String getTypeAliasesPackage() {
|
|
|
- return this.typeAliasesPackage;
|
|
|
- }
|
|
|
-
|
|
|
- public void setTypeAliasesPackage(String typeAliasesPackage) {
|
|
|
- this.typeAliasesPackage = typeAliasesPackage;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @since 1.3.3
|
|
|
- */
|
|
|
- public Class<?> getTypeAliasesSuperType() {
|
|
|
- return typeAliasesSuperType;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @since 1.3.3
|
|
|
- */
|
|
|
- public void setTypeAliasesSuperType(Class<?> typeAliasesSuperType) {
|
|
|
- this.typeAliasesSuperType = typeAliasesSuperType;
|
|
|
- }
|
|
|
-
|
|
|
- public boolean isCheckConfigLocation() {
|
|
|
- return this.checkConfigLocation;
|
|
|
- }
|
|
|
-
|
|
|
- public void setCheckConfigLocation(boolean checkConfigLocation) {
|
|
|
- this.checkConfigLocation = checkConfigLocation;
|
|
|
- }
|
|
|
-
|
|
|
- public ExecutorType getExecutorType() {
|
|
|
- return this.executorType;
|
|
|
- }
|
|
|
-
|
|
|
- public void setExecutorType(ExecutorType executorType) {
|
|
|
- this.executorType = executorType;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @since 1.2.0
|
|
|
- */
|
|
|
- public Properties getConfigurationProperties() {
|
|
|
- return configurationProperties;
|
|
|
- }
|
|
|
+ private String typeEnumsPackage;
|
|
|
|
|
|
/**
|
|
|
- * @since 1.2.0
|
|
|
+ * TODO 全局配置
|
|
|
*/
|
|
|
- public void setConfigurationProperties(Properties configurationProperties) {
|
|
|
- this.configurationProperties = configurationProperties;
|
|
|
- }
|
|
|
-
|
|
|
- public MybatisConfiguration getConfiguration() {
|
|
|
- return configuration;
|
|
|
- }
|
|
|
-
|
|
|
- public void setConfiguration(MybatisConfiguration configuration) {
|
|
|
- this.configuration = configuration;
|
|
|
- }
|
|
|
-
|
|
|
- public GlobalConfig getGlobalConfig() {
|
|
|
- return globalConfig;
|
|
|
- }
|
|
|
+ @NestedConfigurationProperty
|
|
|
+ private GlobalConfig globalConfig = GlobalConfigUtils.defaults();
|
|
|
|
|
|
- public void setGlobalConfig(GlobalConfig globalConfig) {
|
|
|
- this.globalConfig = globalConfig;
|
|
|
- }
|
|
|
|
|
|
public Resource[] resolveMapperLocations() {
|
|
|
return Stream.of(Optional.ofNullable(this.mapperLocations).orElse(new String[0]))
|