类 PlatformPlaceholderDatabaseDriverResolver
java.lang.Object
org.springframework.boot.jdbc.init.PlatformPlaceholderDatabaseDriverResolver
Utility class that can resolve placeholder text with the actual
DatabaseDriver
platform.
By default, the name of the platform is the ID of the
driver. This mapping can be customized by
withDriverPlatform(DatabaseDriver, String) registering custom
DatabaseDriver to platform mappings.
- 从以下版本开始:
- 2.6.0
- 作者:
- Phillip Webb, Andy Wilkinson
-
构造器概要
构造器构造器说明Creates a new resolver that will use the default"@@platform@@"placeholder.PlatformPlaceholderDatabaseDriverResolver(String placeholder) Creates a new resolver that will use the givenplaceholder. -
方法概要
修饰符和类型方法说明resolveAll(String platform, String... values) Resolves the placeholders in the givenvalues, replacing them with the given platform.resolveAll(DataSource dataSource, String... values) Resolves the placeholders in the givenvalues, replacing them with the platform derived from theDatabaseDriverof the givendataSource.withDriverPlatform(DatabaseDriver driver, String platform) Creates a newPlatformPlaceholderDatabaseDriverResolverthat will map the givendriverto the givenplatform.
-
构造器详细资料
-
PlatformPlaceholderDatabaseDriverResolver
public PlatformPlaceholderDatabaseDriverResolver()Creates a new resolver that will use the default"@@platform@@"placeholder. -
PlatformPlaceholderDatabaseDriverResolver
Creates a new resolver that will use the givenplaceholder.- 参数:
placeholder- the placeholder to use
-
-
方法详细资料
-
withDriverPlatform
public PlatformPlaceholderDatabaseDriverResolver withDriverPlatform(DatabaseDriver driver, String platform) Creates a newPlatformPlaceholderDatabaseDriverResolverthat will map the givendriverto the givenplatform.- 参数:
driver- the driverplatform- the platform- 返回:
- the new resolver
-
resolveAll
Resolves the placeholders in the givenvalues, replacing them with the platform derived from theDatabaseDriverof the givendataSource.- 参数:
dataSource- the DataSource from which theDatabaseDriveris derivedvalues- the values in which placeholders are resolved- 返回:
- the values with their placeholders resolved
-
resolveAll
Resolves the placeholders in the givenvalues, replacing them with the given platform.- 参数:
platform- the platform to usevalues- the values in which placeholders are resolved- 返回:
- the values with their placeholders resolved
- 从以下版本开始:
- 2.6.2
-