当前位置: 首页>>代码示例>>Java>>正文


Java ValidationErrors类代码示例

本文整理汇总了Java中liquibase.exception.ValidationErrors的典型用法代码示例。如果您正苦于以下问题:Java ValidationErrors类的具体用法?Java ValidationErrors怎么用?Java ValidationErrors使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ValidationErrors类属于liquibase.exception包,在下文中一共展示了ValidationErrors类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
@Override
public ValidationErrors validate(DropColumnStatement dropColumnStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    if (dropColumnStatement.isMultiple()) {
        ValidationErrors validationErrors = new ValidationErrors();
        DropColumnStatement firstColumn = dropColumnStatement.getColumns().get(0);

        for (DropColumnStatement drop : dropColumnStatement.getColumns()) {
            validationErrors.addAll(validateSingleColumn(drop));
            if (drop.getTableName() != null && !drop.getTableName().equals(firstColumn.getTableName())) {
                validationErrors.addError("All columns must be targeted at the same table");
            }
            if (drop.isMultiple()) {
                validationErrors.addError("Nested multiple drop column statements are not supported");
            }
        }
        return validationErrors;
    } else {
        return validateSingleColumn(dropColumnStatement);
    }
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:21,代码来源:HiveDropColumnGenerator.java

示例2: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
public ValidationErrors validate(SetNullableStatement setNullableStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();

    validationErrors.checkRequiredField("tableName", setNullableStatement.getTableName());
    validationErrors.checkRequiredField("columnName", setNullableStatement.getColumnName());

    if (database instanceof MSSQLDatabase || database instanceof MySQLDatabase || database instanceof InformixDatabase || database instanceof H2Database) {
        validationErrors.checkRequiredField("columnDataType", setNullableStatement.getColumnDataType());
    }

    try {
        if ((database instanceof DB2Database) && (database.getDatabaseMajorVersion() < 9)) {
            validationErrors.addError("DB2 versions less than 9 do not support modifying null constraints");
        }
    } catch (DatabaseException ignore) {
        //cannot check
    }
    return validationErrors;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:20,代码来源:SetNullableGenerator.java

示例3: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
@Override
public ValidationErrors validate(final AddColumnStatement statement,
      final Database database, final SqlGeneratorChain sqlGeneratorChain) {
   final ValidationErrors errors = new ValidationErrors();
   final LiquibaseDataType dataType = DataTypeFactory.getInstance()
         .fromDescription(statement.getColumnType(), database);

   // Ensure that the SRID parameter is provided.
   if (dataType instanceof GeometryType) {
      final GeometryType geometryType = (GeometryType) dataType;
      if (geometryType.getSRID() == null) {
         errors.addError("The SRID parameter is required on the geometry type");
      }
   }
   final ValidationErrors chainErrors = sqlGeneratorChain.validate(
         statement, database);
   if (chainErrors != null) {
      errors.addAll(chainErrors);
   }
   return errors;
}
 
开发者ID:lonnyj,项目名称:liquibase-spatial,代码行数:22,代码来源:AddGeometryColumnGeneratorGeoDB.java

示例4: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
public ValidationErrors validate(Database database) {
    ValidationErrors changeValidationErrors = new ValidationErrors();
    for (SqlStatement statement : generateStatements(database)) {
        boolean supported = SqlGeneratorFactory.getInstance().supports(statement, database);
        if (!supported) {
            if (statement.skipOnUnsupported()) {
                LogFactory.getLogger().info(getChangeMetaData().getName()+" is not supported on "+database.getTypeName()+" but will continue");
            } else {
                changeValidationErrors.addError(getChangeMetaData().getName()+" is not supported on "+database.getTypeName());
            }
        } else {
            changeValidationErrors.addAll(SqlGeneratorFactory.getInstance().validate(statement, database));
        }
    }

    return changeValidationErrors;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:18,代码来源:AbstractChange.java

示例5: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
@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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:9,代码来源:HiveInsertGenerator.java

示例6: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
@Override
public ValidationErrors validate(MarkChangeSetRanStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("changeSet", statement.getChangeSet());

    return validationErrors;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:HiveMarkChangeSetRanGenerator.java

示例7: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
@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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:RenameTableGenerator.java

示例8: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
@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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:SetGenerator.java

示例9: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
@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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:InsertAsSelectGenerator.java

示例10: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
public ValidationErrors validate(SqlStatement statement, Database database) {
    if (sqlGenerators == null || !sqlGenerators.hasNext()) {
        return new ValidationErrors();
    }

    return sqlGenerators.next().validate(statement, database, this);
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:8,代码来源:SqlGeneratorChain.java

示例11: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
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;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:13,代码来源:SetSequenceGenerator.java

示例12: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
@Override
public ValidationErrors validate(final Database database) {
   final ValidationErrors errors = new ValidationErrors();
   if (!(database instanceof DerbyDatabase || database instanceof H2Database
         || database instanceof MySQLDatabase || database instanceof OracleDatabase || database instanceof PostgresDatabase)) {
      errors.addError(database.getDatabaseProductName() + " is not supported by this extension");
   }
   return errors;
}
 
开发者ID:lonnyj,项目名称:liquibase-spatial,代码行数:10,代码来源:SpatialSupportedPrecondition.java

示例13: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
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, CacheDatabase.class, MSSQLDatabase.class, DerbyDatabase.class, SybaseASADatabase.class, InformixDatabase.class);
    }

    return validationErrors;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:13,代码来源:CreateViewGenerator.java

示例14: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
public ValidationErrors validate(InsertOrUpdateStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();
    validationErrors.checkRequiredField("tableName", statement.getTableName());
    validationErrors.checkRequiredField("columns", statement.getColumnValues());
    validationErrors.checkRequiredField("primaryKey", statement.getPrimaryKey());

    return validationErrors;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:9,代码来源:InsertOrUpdateGenerator.java

示例15: validate

import liquibase.exception.ValidationErrors; //导入依赖的package包/类
public ValidationErrors validate(AddForeignKeyConstraintStatement addForeignKeyConstraintStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
    ValidationErrors validationErrors = new ValidationErrors();

    if ((addForeignKeyConstraintStatement.isInitiallyDeferred() || addForeignKeyConstraintStatement.isDeferrable()) && !database.supportsInitiallyDeferrableColumns()) {
        validationErrors.checkDisallowedField("initiallyDeferred", addForeignKeyConstraintStatement.isInitiallyDeferred(), database);
        validationErrors.checkDisallowedField("deferrable", addForeignKeyConstraintStatement.isDeferrable(), database);
    }

    validationErrors.checkRequiredField("baseColumnNames", addForeignKeyConstraintStatement.getBaseColumnNames());
    validationErrors.checkRequiredField("baseTableNames", addForeignKeyConstraintStatement.getBaseTableName());
    validationErrors.checkRequiredField("referencedColumnNames", addForeignKeyConstraintStatement.getReferencedColumnNames());
    validationErrors.checkRequiredField("referencedTableName", addForeignKeyConstraintStatement.getReferencedTableName());

    return validationErrors;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:16,代码来源:AddForeignKeyConstraintGenerator.java


注:本文中的liquibase.exception.ValidationErrors类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。