Search in sources :

Example 1 with ValidationErrors

use of liquibase.exception.ValidationErrors in project opennms by OpenNMS.

the class SetSequenceGenerator method validate.

@Override
public ValidationErrors validate(final SetSequenceStatement statement, final Database database, final SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("sequenceName", statement.getSequenceName());
    if (statement.getValue() == null) {
        validationErrors.checkRequiredField("tables", statement.getTables());
    } else {
        if (statement.getTables().size() > 0) {
            LogFactory.getLogger().warning("You have set the sequence to a specific value, but have also provided tables to use for inferring the value.  Using the specific value.");
        }
    }
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 2 with ValidationErrors

use of liquibase.exception.ValidationErrors in project opennms by OpenNMS.

the class CreateTypeGenerator method validate.

@Override
public ValidationErrors validate(final CreateTypeStatement statement, final Database database, final SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("name", statement);
    errors.checkRequiredField("columns", statement);
    return errors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 3 with ValidationErrors

use of liquibase.exception.ValidationErrors in project liquibase by liquibase.

the class FindForeignKeyConstraintsGeneratorMSSQL method validate.

@Override
public ValidationErrors validate(FindForeignKeyConstraintsStatement findForeignKeyConstraintsStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("baseTableName", findForeignKeyConstraintsStatement.getBaseTableName());
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 4 with ValidationErrors

use of liquibase.exception.ValidationErrors in project liquibase by liquibase.

the class FindForeignKeyConstraintsGeneratorPostgres method validate.

@Override
public ValidationErrors validate(FindForeignKeyConstraintsStatement findForeignKeyConstraintsStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("baseTableName", findForeignKeyConstraintsStatement.getBaseTableName());
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Example 5 with ValidationErrors

use of liquibase.exception.ValidationErrors in project liquibase by liquibase.

the class FindForeignKeyConstraintsGeneratorDB2 method validate.

@Override
public ValidationErrors validate(FindForeignKeyConstraintsStatement findForeignKeyConstraintsStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("baseTableName", findForeignKeyConstraintsStatement.getBaseTableName());
    return validationErrors;
}
Also used : ValidationErrors(liquibase.exception.ValidationErrors)

Aggregations

ValidationErrors (liquibase.exception.ValidationErrors)102 Test (org.junit.Test)14 MockDatabase (liquibase.database.core.MockDatabase)11 Database (liquibase.database.Database)7 MockSqlStatement (liquibase.statement.core.MockSqlStatement)6 TreeSet (java.util.TreeSet)5 Change (liquibase.change.Change)4 UnexpectedLiquibaseException (liquibase.exception.UnexpectedLiquibaseException)4 SqlStatement (liquibase.statement.SqlStatement)4 ChangeFactory (liquibase.change.ChangeFactory)3 ChangeMetaData (liquibase.change.ChangeMetaData)3 ChangeParameterMetaData (liquibase.change.ChangeParameterMetaData)3 MockSqlGeneratorChain (liquibase.sqlgenerator.MockSqlGeneratorChain)3 AbstractVerifyTest (liquibase.verify.AbstractVerifyTest)3 ArrayList (java.util.ArrayList)2 CreateTableChange (liquibase.change.core.CreateTableChange)2 DatabaseChangeLog (liquibase.changelog.DatabaseChangeLog)2 RanChangeSet (liquibase.changelog.RanChangeSet)2 DatabaseConnection (liquibase.database.DatabaseConnection)2 Db2zDatabase (liquibase.database.core.Db2zDatabase)2