|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectliquibase.change.AbstractChange
liquibase.change.AbstractSQLChange
public abstract class AbstractSQLChange
A common parent for all raw SQL related changes regardless of where the sql was sourced from. Implements the necessary logic to choose how the SQL string should be parsed to generate the statements.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable |
|---|
LiquibaseSerializable.SerializationType |
| Constructor Summary | |
|---|---|
protected |
AbstractSQLChange()
|
| Method Summary | |
|---|---|
CheckSum |
generateCheckSum()
Calculates the checksum based on the contained SQL. |
SqlStatement[] |
generateStatements(Database database)
Generates one or more SqlStatements depending on how the SQL should be parsed. |
String |
getDbms()
|
String |
getEndDelimiter()
Set the end delimiter used to split statements. |
String |
getSql()
Return the raw SQL managed by this Change |
Boolean |
isSplitStatements()
Return if the SQL should be split into multiple statements before passing it to the database. |
Boolean |
isStripComments()
Return if comments should be stripped from the SQL before passing it to the database. |
protected String |
normalizeLineEndings(String string)
|
protected String |
prepareSqlForChecksum(String string)
|
void |
setDbms(String dbms)
|
void |
setEndDelimiter(String endDelimiter)
Set the end delimiter for splitting SQL statements. |
void |
setSplitStatements(Boolean splitStatements)
Set whether SQL should be split into multiple statements. |
void |
setSql(String sql)
Set the raw SQL managed by this Change. |
void |
setStripComments(Boolean stripComments)
Return true if comments should be stripped from the SQL before passing it to the database. |
boolean |
supports(Database database)
Implementation delegates logic to the SqlGenerator.supports(liquibase.statement.SqlStatement, liquibase.database.Database) method on the SqlStatement objects returned by Change.generateStatements(liquibase.database.Database). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface liquibase.change.Change |
|---|
getConfirmationMessage |
| Constructor Detail |
|---|
protected AbstractSQLChange()
| Method Detail |
|---|
public String getDbms()
getDbms in interface DbmsTargetedChangepublic void setDbms(String dbms)
setDbms in interface DbmsTargetedChangepublic boolean supports(Database database)
SqlGenerator.supports(liquibase.statement.SqlStatement, liquibase.database.Database) method on the SqlStatement objects returned by Change.generateStatements(liquibase.database.Database).
If no or null SqlStatements are returned by generateStatements then this method returns true.
If AbstractChange.generateStatementsVolatile(liquibase.database.Database) returns true, we cannot call generateStatements and so assume true.
supports in interface Changesupports in class AbstractChangedatabase -
public Boolean isStripComments()
public void setStripComments(Boolean stripComments)
public Boolean isSplitStatements()
public void setSplitStatements(Boolean splitStatements)
public String getSql()
public void setSql(String sql)
public String getEndDelimiter()
splitStatementspublic void setEndDelimiter(String endDelimiter)
endDelimiter - public CheckSum generateCheckSum()
generateCheckSum in interface ChangegenerateCheckSum in class AbstractChangeAbstractChange.generateCheckSum()public SqlStatement[] generateStatements(Database database)
Connection.nativeSQL(java.lang.String) method if a connection is available.
generateStatements in interface Changeprotected String normalizeLineEndings(String string)
protected String prepareSqlForChecksum(String string)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||