use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class AddPrimaryKeyGenerator method validate.
@Override
public ValidationErrors validate(AddPrimaryKeyStatement addPrimaryKeyStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("columnNames", addPrimaryKeyStatement.getColumnNames());
validationErrors.checkRequiredField("tableName", addPrimaryKeyStatement.getTableName());
if (!(database instanceof MSSQLDatabase || database instanceof MockDatabase)) {
if (addPrimaryKeyStatement.isClustered() != null && !addPrimaryKeyStatement.isClustered()) {
validationErrors.checkDisallowedField("clustered", addPrimaryKeyStatement.isClustered(), database);
}
}
if (!(database instanceof OracleDatabase || database instanceof DB2Database)) {
validationErrors.checkDisallowedField("forIndexName", addPrimaryKeyStatement.getForIndexName(), database);
}
return validationErrors;
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class CommentGenerator method validate.
@Override
public ValidationErrors validate(CommentStatement comment, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("text", comment.getText());
return validationErrors;
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class CopyRowsGenerator method validate.
@Override
public ValidationErrors validate(CopyRowsStatement copyRowsStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("targetTable", copyRowsStatement.getTargetTable());
validationErrors.checkRequiredField("sourceTable", copyRowsStatement.getSourceTable());
validationErrors.checkRequiredField("copyColumns", copyRowsStatement.getCopyColumns());
return validationErrors;
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class CreateIndexGenerator method validate.
@Override
public ValidationErrors validate(CreateIndexStatement createIndexStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("tableName", createIndexStatement.getTableName());
validationErrors.checkRequiredField("columns", createIndexStatement.getColumns());
if (database instanceof HsqlDatabase) {
validationErrors.checkRequiredField("name", createIndexStatement.getIndexName());
}
return validationErrors;
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class AddAutoIncrementGenerator method validate.
@Override
public ValidationErrors validate(AddAutoIncrementStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("columnName", statement.getColumnName());
validationErrors.checkRequiredField("tableName", statement.getTableName());
validationErrors.checkRequiredField("columnDataType", statement.getColumnDataType());
return validationErrors;
}
Aggregations