com.googlecode.flyway.core.dbsupport.hsql
Class HsqlSqlScript
java.lang.Object
com.googlecode.flyway.core.migration.sql.SqlScript
com.googlecode.flyway.core.dbsupport.hsql.HsqlSqlScript
public class HsqlSqlScript
- extends SqlScript
SqlScript supporting Hsql-specific delimiter changes.
|
Constructor Summary |
HsqlSqlScript(java.lang.String sqlScriptSource,
PlaceholderReplacer placeholderReplacer)
Creates a new sql script from this source with these placeholders to replace. |
|
Method Summary |
protected java.lang.String |
changeDelimiterIfNecessary(java.lang.String statement,
java.lang.String line,
java.lang.String delimiter)
Checks whether this line in the sql script indicates that the statement delimiter will be different from the
current one. |
protected boolean |
endsWithOpenMultilineStringLiteral(java.lang.String statement)
Checks whether the statement we have assembled so far ends with an open multi-line string literal (which will be
continued on the next line). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HsqlSqlScript
public HsqlSqlScript(java.lang.String sqlScriptSource,
PlaceholderReplacer placeholderReplacer)
- Creates a new sql script from this source with these placeholders to replace.
- Parameters:
sqlScriptSource - The sql script as a text block with all placeholders still present.placeholderReplacer - The placeholder replacer to apply to sql migration scripts.
- Throws:
java.lang.IllegalStateException - Thrown when the script could not be read from this resource.
changeDelimiterIfNecessary
protected java.lang.String changeDelimiterIfNecessary(java.lang.String statement,
java.lang.String line,
java.lang.String delimiter)
- Description copied from class:
SqlScript
- Checks whether this line in the sql script indicates that the statement delimiter will be different from the
current one. Useful for database-specific stored procedures and block constructs.
- Overrides:
changeDelimiterIfNecessary in class SqlScript
- Parameters:
statement - The statement assembled so far, reduced to a single line with all linebreaks replaced by
spaces.line - The line to analyse.delimiter - The current delimiter.
- Returns:
- The new delimiter to use (can be the same as the current one) or
null for no delimiter.
endsWithOpenMultilineStringLiteral
protected boolean endsWithOpenMultilineStringLiteral(java.lang.String statement)
- Description copied from class:
SqlScript
- Checks whether the statement we have assembled so far ends with an open multi-line string literal (which will be
continued on the next line).
- Overrides:
endsWithOpenMultilineStringLiteral in class SqlScript
- Parameters:
statement - The current statement, assembled from the lines we have parsed so far. May not yet be complete.
- Returns:
true if the statement is unfinished and the end is currently in the middle of a multi-line string
literal. false if not.
Copyright © 2011. All Rights Reserved.