Java Code Examples for liquibase.exception.ValidationErrors#checkRequiredField()

The following examples show how to use liquibase.exception.ValidationErrors#checkRequiredField() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HiveInsertGenerator.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public ValidationErrors validate(HiveInsertStatement insertStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("tableName", insertStatement.getTableName());
    validationErrors.checkRequiredField("columns", insertStatement.getColumnValues());

    return validationErrors;
}
 
Example 2
Source File: AbstractCreateSpatialIndexGenerator.java    From liquibase-spatial with Apache License 2.0 5 votes vote down vote up
/**
 * Ensures that the table name and columns are populated.
 * 
 * @see SqlGenerator#validate(liquibase.statement.SqlStatement, Database, SqlGeneratorChain)
 */
@Override
public ValidationErrors validate(final CreateSpatialIndexStatement statement,
      final Database database, final SqlGeneratorChain sqlGeneratorChain) {
   final ValidationErrors validationErrors = new ValidationErrors();
   validationErrors.checkRequiredField("tableName", statement.getTableName());
   validationErrors.checkRequiredField("columns", statement.getColumns());
   return validationErrors;
}
 
Example 3
Source File: CreateSpatialIndexGeneratorGeoDB.java    From liquibase-spatial with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc} Also ensures that the SRID is populated.
 */
@Override
public ValidationErrors validate(final CreateSpatialIndexStatement statement,
      final Database database, final SqlGeneratorChain sqlGeneratorChain) {
   final ValidationErrors validationErrors = super.validate(statement, database,
         sqlGeneratorChain);
   validationErrors.checkRequiredField("srid", statement.getSrid());
   return validationErrors;
}
 
Example 4
Source File: DropSpatialIndexGeneratorOracle.java    From liquibase-spatial with Apache License 2.0 5 votes vote down vote up
/**
 * Ensures that the index name is populated.
 */
@Override
public ValidationErrors validate(final DropSpatialIndexStatement statement,
      final Database database, final SqlGeneratorChain sqlGeneratorChain) {
   final ValidationErrors validationErrors = new ValidationErrors();
   validationErrors.checkRequiredField("indexName", statement.getIndexName());
   return validationErrors;
}
 
Example 5
Source File: DropSpatialIndexGeneratorGeoDB.java    From liquibase-spatial with Apache License 2.0 5 votes vote down vote up
/**
 * Ensures that the table name is populated.
 */
@Override
public ValidationErrors validate(final DropSpatialIndexStatement statement,
      final Database database, final SqlGeneratorChain sqlGeneratorChain) {
   final ValidationErrors validationErrors = new ValidationErrors();
   validationErrors.checkRequiredField("tableName", statement.getTableName());
   return validationErrors;
}
 
Example 6
Source File: InsertAsSelectGenerator.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public ValidationErrors validate(InsertAsSelectStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("tableName", statement.getTableName());
    errors.checkRequiredField("dstTableName", statement.getDestTableName());
    return errors;
}
 
Example 7
Source File: SetGenerator.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public ValidationErrors validate(SetStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("queryOption", statement.getQueryOption());
    errors.checkRequiredField("optionValue", statement.getOptionValue());
    return errors;
}
 
Example 8
Source File: RenameTableGenerator.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public ValidationErrors validate(RenameTableStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("newTableName", statement.getNewTableName());
    errors.checkRequiredField("oldTableName", statement.getOldTableName());
    return errors;
}
 
Example 9
Source File: HiveMarkChangeSetRanGenerator.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public ValidationErrors validate(MarkChangeSetRanStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("changeSet", statement.getChangeSet());

    return validationErrors;
}
 
Example 10
Source File: CreateTableAsSelectGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
public ValidationErrors validate(CreateTableAsSelectStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("tableName", statement.getTableName());
    return errors;
}
 
Example 11
Source File: ImpalaMarkChangeSetRanGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
public ValidationErrors validate(MarkChangeSetRanStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("changeSet", statement.getChangeSet());
    return errors;
}
 
Example 12
Source File: ImpalaTagDatabaseGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
public ValidationErrors validate(TagDatabaseStatement tagDatabaseStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("tag", tagDatabaseStatement.getTag());
    return validationErrors;
}
 
Example 13
Source File: ImpalaInvalidateMetadataGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
public ValidationErrors validate(InvalidateMetadataStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("tableName", statement.getTableName());
    return errors;
}
 
Example 14
Source File: ImpalaCreateTableAsSelectGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
public ValidationErrors validate(CreateTableAsSelectStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("tableName", statement.getTableName());
    return errors;
}
 
Example 15
Source File: ImpalaRefreshTableGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
public ValidationErrors validate(RefreshTableStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("tableName", statement.getTableName());
    return errors;
}
 
Example 16
Source File: TruncateGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
public ValidationErrors validate(TruncateTableStatement truncateStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    final ValidationErrors errors = new ValidationErrors();
    errors.checkRequiredField("tableName", truncateStatement.getTableName());
    return errors;
}
 
Example 17
Source File: HiveTagDatabaseGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
public ValidationErrors validate(TagDatabaseStatement tagDatabaseStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("tag", tagDatabaseStatement.getTag());
    return validationErrors;
}
 
Example 18
Source File: HiveDropColumnGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
private ValidationErrors validateSingleColumn(DropColumnStatement dropColumnStatement) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("tableName", dropColumnStatement.getTableName());
    validationErrors.checkRequiredField("columnName", dropColumnStatement.getColumnName());
    return validationErrors;
}