public class PlatformPlaceholderDatabaseDriverResolver extends Object
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.
| Constructor and Description |
|---|
PlatformPlaceholderDatabaseDriverResolver()
Creates a new resolver that will use the default
"@@platform@@"
placeholder. |
PlatformPlaceholderDatabaseDriverResolver(String placeholder)
Creates a new resolver that will use the given
placeholder. |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
resolveAll(DataSource dataSource,
String... values)
Resolves the placeholders in the given
values, replacing them with the
platform derived from the DatabaseDriver of the given dataSource. |
List<String> |
resolveAll(String platform,
String... values)
Resolves the placeholders in the given
values, replacing them with the
given platform. |
PlatformPlaceholderDatabaseDriverResolver |
withDriverPlatform(DatabaseDriver driver,
String platform)
Creates a new
PlatformPlaceholderDatabaseDriverResolver that will map the
given driver to the given platform. |
public PlatformPlaceholderDatabaseDriverResolver()
"@@platform@@"
placeholder.public PlatformPlaceholderDatabaseDriverResolver(String placeholder)
placeholder.placeholder - the placeholder to usepublic PlatformPlaceholderDatabaseDriverResolver withDriverPlatform(DatabaseDriver driver, String platform)
PlatformPlaceholderDatabaseDriverResolver that will map the
given driver to the given platform.driver - the driverplatform - the platformpublic List<String> resolveAll(DataSource dataSource, String... values)
values, replacing them with the
platform derived from the DatabaseDriver of the given dataSource.dataSource - the DataSource from which the DatabaseDriver is derivedvalues - the values in which placeholders are resolvedpublic List<String> resolveAll(String platform, String... values)
values, replacing them with the
given platform.platform - the platform to usevalues - the values in which placeholders are resolved