@Configurable public class DatabaseObjectConversion extends AbstractDataConversion
_dependencies, _postDDL, _preDDL, _requiresDowntime, _version
_description, _identifier, _taskLogger
COMPARATOR
Modifier | Constructor and Description |
---|---|
protected |
DatabaseObjectConversion(DatabaseObjectType databaseObjectType,
String identifier,
String description,
long version,
boolean requiresDowntime,
Set<DataConversion> dependencies,
List<SQLStatement> preDDL,
List<SQLStatement> postDDL)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static DatabaseObjectConversion |
create(DatabaseObjectType databaseObjectType,
String identifier,
String description,
Long version,
boolean requiresDowntime)
Create a procedure conversion.
|
List<? extends SQLStatement> |
execute(TaskArgument[] arguments)
The SQL statements returned should not include any DDL statements.
|
List<SQLStatement> |
getPostConversionDDL()
Get any DDL statements that must be after the conversion.
|
List<SQLStatement> |
getPreConversionDDL()
Get any DDL statements that must be run before the conversion.
|
protected boolean |
isValid(DataSource dataSource)
Test if the conversion is valid.
|
DatabaseObjectConversion |
limitToDatabase(String databaseProductName)
Only run the data conversion if the product name of the database
matches the specified product name.
|
DatabaseObjectConversion |
limitToDatabase(String databaseProductName,
int majorVersion,
int minorVersion)
Only run the data conversion if the product name of the database
matches the specified product name.
|
DatabaseObjectConversion |
withPostDDL(String ddl,
String description)
Post DDL.
|
DatabaseObjectConversion |
withPreDDL(String ddl,
String description)
Pre DDL.
|
checkResultSet, coerceList, equals, getDependencies, getValidationStatements, getVersion, hashCode, requiresDowntime, toString, validateResult
closeConnection, doesDatabaseObjectExist, doesDatabaseObjectExist, doesDatabaseObjectExist, doesDatabaseObjectExist, generateList, getAdditionalArguments, getArgumentMapping, getDataSourceArgument, getDescription, getIdentifier, getTableColumn, getTableColumn, validateArguments
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAdditionalArguments, getDescription, getIdentifier, validateArguments
protected DatabaseObjectConversion(DatabaseObjectType databaseObjectType, String identifier, String description, long version, boolean requiresDowntime, @Nullable Set<DataConversion> dependencies, @Nullable List<SQLStatement> preDDL, @Nullable List<SQLStatement> postDDL)
databaseObjectType
- the database object type.identifier
- the identifier.description
- the description.version
- the version.requiresDowntime
- true if the conversion requires downtime. This indicates that it cannot be run while the server is
running.dependencies
- any dependencies.preDDL
- the DDL dependencies.postDDL
- the DDL dependencies.public static DatabaseObjectConversion create(DatabaseObjectType databaseObjectType, String identifier, String description, Long version, boolean requiresDowntime)
databaseObjectType
- the database object type.identifier
- the identifier.description
- the description.version
- the version.requiresDowntime
- true if the conversion requires downtime. This indicates that it cannot be run while the server is
running.public List<? extends SQLStatement> execute(TaskArgument[] arguments) throws IllegalArgumentException, SQLException, IllegalArgumentException
getPreConversionDDL()
or getPostConversionDDL()
The SQL statements returned should not include any DDL statements. DDL statements must be returned using DataConversion.getPreConversionDDL()
or DataConversion.getPostConversionDDL()
Execute the task using the specified arguments. Some tasks such as DataConversions, will execute SQL statements. Other tasks
may do things, like send an email in which case they will not return SQL statements.arguments
- the task arguments.IllegalArgumentException
- if the arguments are invalid.SQLException
- if a SQL Exception occurs.public List<SQLStatement> getPostConversionDDL()
DataConversion
getPostConversionDDL
in interface DataConversion
getPostConversionDDL
in class AbstractDataConversion
public List<SQLStatement> getPreConversionDDL()
DataConversion
getPreConversionDDL
in interface DataConversion
getPreConversionDDL
in class AbstractDataConversion
protected boolean isValid(DataSource dataSource)
dataSource
- the data source.public DatabaseObjectConversion limitToDatabase(String databaseProductName)
databaseProductName
- the database product name.public DatabaseObjectConversion limitToDatabase(String databaseProductName, int majorVersion, int minorVersion)
databaseProductName
- the database product name. Examples: "PostgreSQL", "MySQL", "Oracle", "Apache Derby".majorVersion
- the major version number. If less than 1, this is not used to limit.minorVersion
- the minor version number. If less than 1, this is not used to limit.public DatabaseObjectConversion withPostDDL(String ddl, @Nullable String description)
ddl
- the DDL statement.description
- the description.public DatabaseObjectConversion withPreDDL(String ddl, @Nullable String description)
ddl
- the DDL statement.description
- the description.