|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.code.flyway.core.SqlScript
public class SqlScript
Sql script containing a series of statements terminated by semi-columns (;). Single-line (--) and multi-line (/* * /) comments are stripped and ignored.
| Constructor Summary | |
|---|---|
protected |
SqlScript()
Dummy constructor to increase testability. |
|
SqlScript(java.util.List<SqlStatement> sqlStatements,
java.lang.String name)
Creates a new SqlScript with these statements and this name. |
|
SqlScript(org.springframework.core.io.Resource resource,
java.util.Map<java.lang.String,java.lang.String> placeholders)
Creates a new sql script from this resource with these placeholders to replace. |
| Method Summary | |
|---|---|
protected java.lang.String |
checkForNewDelimiter(java.lang.String line)
Checks whether this line in the sql script indicates that the statement delimiter will be different from the default one. |
void |
execute(org.springframework.transaction.support.TransactionTemplate transactionTemplate,
org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
Executes this script against the database. |
java.util.List<SqlStatement> |
getSqlStatements()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SqlScript(org.springframework.core.io.Resource resource,
java.util.Map<java.lang.String,java.lang.String> placeholders)
resource - The resource containing the sql script.placeholders - A map of java.lang.IllegalStateException - Thrown when the script could not be read from this resource.
public SqlScript(java.util.List<SqlStatement> sqlStatements,
java.lang.String name)
sqlStatements - The statements of the script.name - The name of the script.protected SqlScript()
| Method Detail |
|---|
public java.util.List<SqlStatement> getSqlStatements()
public void execute(org.springframework.transaction.support.TransactionTemplate transactionTemplate,
org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
transactionTemplate - The transaction template to use.jdbcTemplate - The jdbc template to use to execute this script.protected java.lang.String checkForNewDelimiter(java.lang.String line)
line - The line to analyse.
null if no change in delimiter is required.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||