R - the resulting DBRow from this DBQueryInsertActionpublic class DBMigrationAction<R extends DBRow> extends DBAction
Support DBvolution at Patreon
| Constructor and Description |
|---|
DBMigrationAction(DBMigration<R> migration,
DBRow resultRow,
DBRow... examples)
Creates a DBMigrate action for the row.
|
| Modifier and Type | Method and Description |
|---|---|
DBActionList |
execute(DBDatabase db)
Performs the DB execute and returns a list of all actions performed in the
process.
|
protected DBActionList |
getActions()
Returns a DBActionList of the actions required to perform this DBAction.
|
protected DBActionList |
getRevertDBActionList()
Returns a DBActionList containing the changes required to revert the
DBAction.
|
ArrayList<String> |
getSQLStatements(DBDatabase db)
Returns a list of the SQL statements that this DBAction will produce for
the specified database.
|
DBActionList |
migrate(DBDatabase database)
Perform the migration
|
getPrimaryKeySQL, getRowpublic DBMigrationAction(DBMigration<R> migration, DBRow resultRow, DBRow... examples)
migration - the mapping to transform the source dataresultRow - the resulting DBRow produced by the mappingexamples - extra examples used to reduce the source data set.public DBActionList migrate(DBDatabase database) throws SQLException
database - the database used by this action
Support DBvolution at Patreon
SQLException - SQL Exceptions may be thrownpublic ArrayList<String> getSQLStatements(DBDatabase db)
DBActionActions happen all by themselves but when you want to know what will actually happen, use this method to get a complete list of all the SQL required.
getSQLStatements in class DBActiondb - the database that the SQL must be appropriate for.
Support DBvolution at Patreon
public DBActionList execute(DBDatabase db) throws SQLException
DBExecutableThe supplied row will be changed by the action in an appropriate way, however the Action will contain an unchanged and unchangeable copy of the row for internal use.
db - the target database.
Support DBvolution at Patreon
SQLException - Database operations may throw SQLExceptionsprotected DBActionList getRevertDBActionList()
DBActionEvery action has an opposite reaction. This method supplies the actions require to revert the change enacted by the action.
Revert actions are tricky to implement correctly, so be sure to check that the revert will produce the desired result.
Support DBvolution at Patreon
getRevertDBActionList in class DBActionprotected DBActionList getActions()
DBActionActions are allowed to create sub-actions so all actions are returned as a DBActionList.
Support DBvolution at Patreon
getActions in class DBActionCopyright © 2017. All Rights Reserved.