public abstract class Patch extends OperationCriticalTransaction
dbType, success
Constructor and Description |
---|
Patch() |
Modifier and Type | Method and Description |
---|---|
protected void |
addColumn(java.lang.String tableName,
java.lang.String columnInfo) |
protected boolean |
allValuesHaveValueZero(java.lang.String tableName,
java.lang.String column) |
protected abstract void |
applyPatch() |
protected void |
dropForeignKeys(java.lang.String referencedTable) |
protected void |
dropTable(java.lang.String name) |
protected void |
ensureNoForeignKeyConstraints(java.lang.String table) |
abstract boolean |
hasBeenApplied() |
protected boolean |
hasColumn(java.lang.String tableName,
java.lang.String columnName) |
protected boolean |
hasTable(java.lang.String tableName) |
protected void |
performOperations()
Implement this method for transaction execution.
|
protected void |
renameTable(java.lang.String from,
java.lang.String to) |
protected boolean |
shouldBeExecuted()
Override this method for conditional execution.
|
executeTransaction
execute, execute, executeOther, executeSwallowingExceptions, getServerUUID, query, toString, wasSuccessful
public abstract boolean hasBeenApplied()
protected abstract void applyPatch()
protected boolean shouldBeExecuted()
Transaction
Please note that the transaction has not been initialized and class variables are not available for queries. The condition should depend on other variables (Like the data that is to be stored) given to the transaction.
shouldBeExecuted
in class Transaction
protected void performOperations()
Transaction
performOperations
in class Transaction
protected boolean hasTable(java.lang.String tableName)
protected boolean hasColumn(java.lang.String tableName, java.lang.String columnName)
protected void addColumn(java.lang.String tableName, java.lang.String columnInfo)
protected void dropTable(java.lang.String name)
protected void renameTable(java.lang.String from, java.lang.String to)
protected void dropForeignKeys(java.lang.String referencedTable)
protected void ensureNoForeignKeyConstraints(java.lang.String table)
protected boolean allValuesHaveValueZero(java.lang.String tableName, java.lang.String column)