public class PlatformPlaceholderDatabaseDriverResolver
extends java.lang.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(java.lang.String placeholder)
Creates a new resolver that will use the given
placeholder . |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
resolveAll(javax.sql.DataSource dataSource,
java.lang.String... values)
Resolves the placeholders in the given
values , replacing them with the
platform derived from the DatabaseDriver of the given dataSource . |
PlatformPlaceholderDatabaseDriverResolver |
withDriverPlatform(DatabaseDriver driver,
java.lang.String platform)
Creates a new
PlatformPlaceholderDatabaseDriverResolver that will map the
given driver to the given platform . |
public PlatformPlaceholderDatabaseDriverResolver()
"@@platform@@"
placeholder.public PlatformPlaceholderDatabaseDriverResolver(java.lang.String placeholder)
placeholder
.placeholder
- the placeholder to usepublic PlatformPlaceholderDatabaseDriverResolver withDriverPlatform(DatabaseDriver driver, java.lang.String platform)
PlatformPlaceholderDatabaseDriverResolver
that will map the
given driver
to the given platform
.driver
- the driverplatform
- the platformpublic java.util.List<java.lang.String> resolveAll(javax.sql.DataSource dataSource, java.lang.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 resolvedDatabaseDriver.fromDataSource(DataSource)