use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class CreateTableGenerator method validate.
@Override
public ValidationErrors validate(CreateTableStatement createTableStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("tableName", createTableStatement.getTableName());
validationErrors.checkRequiredField("columns", createTableStatement.getColumns());
return validationErrors;
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class CreateViewGenerator method validate.
@Override
public ValidationErrors validate(CreateViewStatement createViewStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
if (database instanceof InformixDatabase) {
return new CreateViewGeneratorInformix().validate(createViewStatement, database, sqlGeneratorChain);
}
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("viewName", createViewStatement.getViewName());
validationErrors.checkRequiredField("selectQuery", createViewStatement.getSelectQuery());
if (createViewStatement.isReplaceIfExists()) {
validationErrors.checkDisallowedField("replaceIfExists", createViewStatement.isReplaceIfExists(), database, HsqlDatabase.class, DB2Database.class, DerbyDatabase.class, SybaseASADatabase.class, InformixDatabase.class);
}
return validationErrors;
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class CreateViewGeneratorInformix method validate.
@Override
public ValidationErrors validate(CreateViewStatement createViewStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("viewName", createViewStatement.getViewName());
validationErrors.checkRequiredField("selectQuery", createViewStatement.getSelectQuery());
if (createViewStatement.isReplaceIfExists()) {
validationErrors.checkDisallowedField("replaceIfExists", createViewStatement.isReplaceIfExists(), database, HsqlDatabase.class, H2Database.class, DB2Database.class, MSSQLDatabase.class, DerbyDatabase.class, SybaseASADatabase.class, InformixDatabase.class);
}
return validationErrors;
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class DeleteGenerator method validate.
@Override
public ValidationErrors validate(DeleteStatement deleteStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("tableName", deleteStatement.getTableName());
if (deleteStatement.getWhereParameters() != null && deleteStatement.getWhereParameters().size() > 0 && deleteStatement.getWhere() == null) {
validationErrors.addError("whereParams set but no whereClause");
}
return validationErrors;
}
use of liquibase.exception.ValidationErrors in project liquibase by liquibase.
the class FindForeignKeyConstraintsGeneratorHsql method validate.
public ValidationErrors validate(FindForeignKeyConstraintsStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("baseTableName", statement.getBaseTableName());
return validationErrors;
}
Aggregations