Skip to content

Commit 2b95e98

Browse files
committed
Support configuration databaseId.
#911
1 parent b827bf6 commit 2b95e98

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/MybatisProperties.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ public static class CoreConfiguration {
409409
*/
410410
private Properties variables;
411411

412+
/**
413+
* Specifies the database identify value for switching query to use.
414+
*/
415+
private String databaseId;
416+
412417
public Boolean getSafeRowBoundsEnabled() {
413418
return safeRowBoundsEnabled;
414419
}
@@ -657,6 +662,14 @@ public void setDefaultEnumTypeHandler(Class<? extends TypeHandler> defaultEnumTy
657662
this.defaultEnumTypeHandler = defaultEnumTypeHandler;
658663
}
659664

665+
public String getDatabaseId() {
666+
return databaseId;
667+
}
668+
669+
public void setDatabaseId(String databaseId) {
670+
this.databaseId = databaseId;
671+
}
672+
660673
public void applyTo(Configuration target) {
661674
PropertyMapper mapper = PropertyMapper.get().alwaysApplyingWhenNonNull();
662675
mapper.from(getSafeRowBoundsEnabled()).to(target::setSafeRowBoundsEnabled);
@@ -690,6 +703,7 @@ public void applyTo(Configuration target) {
690703
mapper.from(getDefaultSqlProviderType()).to(target::setDefaultSqlProviderType);
691704
mapper.from(getConfigurationFactory()).to(target::setConfigurationFactory);
692705
mapper.from(getDefaultEnumTypeHandler()).to(target::setDefaultEnumTypeHandler);
706+
mapper.from(getDatabaseId()).to(target::setDatabaseId);
693707
}
694708

695709
}

0 commit comments

Comments
 (0)