public class FlywaySqlScript extends Object
Constructor and Description |
---|
FlywaySqlScript(com.whitestein.flywaydb.core.internal.dbsupport.DbSupport dbSupport,
com.whitestein.flywaydb.core.internal.util.scanner.Resource sqlScriptResource,
com.whitestein.flywaydb.core.internal.util.PlaceholderReplacer placeholderReplacer,
String encoding)
Creates a new sql script from this resource.
|
FlywaySqlScript(String sqlScriptSource,
int initialLineNumber,
com.whitestein.flywaydb.core.internal.dbsupport.DbSupport dbSupport)
Creates a new sql script from this source.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(com.whitestein.flywaydb.core.internal.dbsupport.JdbcTemplate jdbcTemplate)
Executes this script against the database.
|
com.whitestein.flywaydb.core.internal.util.scanner.Resource |
getResource() |
List<com.whitestein.flywaydb.core.internal.dbsupport.SqlStatement> |
getSqlStatements()
For increased testability.
|
protected List<com.whitestein.flywaydb.core.internal.dbsupport.SqlStatement> |
linesToStatements(List<String> lines,
int initialLineNumber)
Turns these lines in a series of statements.
|
public FlywaySqlScript(String sqlScriptSource, int initialLineNumber, com.whitestein.flywaydb.core.internal.dbsupport.DbSupport dbSupport)
sqlScriptSource
- The sql script as a text block with all placeholders already replaced.initialLineNumber
- dbSupport
- The database-specific support.public FlywaySqlScript(com.whitestein.flywaydb.core.internal.dbsupport.DbSupport dbSupport, com.whitestein.flywaydb.core.internal.util.scanner.Resource sqlScriptResource, com.whitestein.flywaydb.core.internal.util.PlaceholderReplacer placeholderReplacer, String encoding)
dbSupport
- The database-specific support.sqlScriptResource
- The resource containing the statements.placeholderReplacer
- The placeholder replacer.encoding
- The encoding to use.public List<com.whitestein.flywaydb.core.internal.dbsupport.SqlStatement> getSqlStatements()
public com.whitestein.flywaydb.core.internal.util.scanner.Resource getResource()
public void execute(com.whitestein.flywaydb.core.internal.dbsupport.JdbcTemplate jdbcTemplate)
jdbcTemplate
- The jdbc template to use to execute this script.protected List<com.whitestein.flywaydb.core.internal.dbsupport.SqlStatement> linesToStatements(List<String> lines, int initialLineNumber)
lines
- The lines to analyse.initialLineNumber
- Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.