本文整理汇总了Java中liquibase.exception.ValidationErrors.checkRequiredField方法的典型用法代码示例。如果您正苦于以下问题:Java ValidationErrors.checkRequiredField方法的具体用法?Java ValidationErrors.checkRequiredField怎么用?Java ValidationErrors.checkRequiredField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类liquibase.exception.ValidationErrors
的用法示例。
在下文中一共展示了ValidationErrors.checkRequiredField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import liquibase.exception.ValidationErrors; //导入方法依赖的package包/类
public ValidationErrors validate(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("columnName", statement.getColumnName());
validationErrors.checkRequiredField("columnType", statement.getColumnType());
validationErrors.checkRequiredField("tableName", statement.getTableName());
if (statement.isPrimaryKey() && (database instanceof CacheDatabase
|| database instanceof H2Database
|| database instanceof DB2Database
|| database instanceof DerbyDatabase
|| database instanceof SQLiteDatabase)) {
validationErrors.addError("Cannot add a primary key column");
}
// TODO HsqlDatabase autoincrement on non primary key? other databases?
if (database instanceof MySQLDatabase && statement.isAutoIncrement() && !statement.isPrimaryKey()) {
validationErrors.addError("Cannot add a non-primary key identity column");
}
return validationErrors;
}
示例2: validate
import liquibase.exception.ValidationErrors; //导入方法依赖的package包/类
public ValidationErrors validate(
AddAutoIncrementStatement statement,
Database database,
SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("columnName", statement.getColumnName());
validationErrors.checkRequiredField("tableName", statement.getTableName());
return validationErrors;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: validate
import liquibase.exception.ValidationErrors; //导入方法依赖的package包/类
public ValidationErrors validate(DropDefaultValueStatement dropDefaultValueStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("tableName", dropDefaultValueStatement.getTableName());
validationErrors.checkRequiredField("columnName", dropDefaultValueStatement.getColumnName());
if (database instanceof InformixDatabase) {
validationErrors.checkRequiredField("columnDataType", dropDefaultValueStatement.getColumnDataType());
}
return validationErrors;
}
示例9: 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;
}
示例10: validate
import liquibase.exception.ValidationErrors; //导入方法依赖的package包/类
public ValidationErrors validate(SetColumnRemarksStatement setColumnRemarksStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("tableName", setColumnRemarksStatement.getTableName());
validationErrors.checkRequiredField("columnName", setColumnRemarksStatement.getColumnName());
validationErrors.checkRequiredField("remarks", setColumnRemarksStatement.getRemarks());
return validationErrors;
}
示例11: 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;
}
示例12: validate
import liquibase.exception.ValidationErrors; //导入方法依赖的package包/类
public ValidationErrors validate(RenameColumnStatement renameColumnStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("tableName", renameColumnStatement.getTableName());
validationErrors.checkRequiredField("oldColumnName", renameColumnStatement.getOldColumnName());
validationErrors.checkRequiredField("newColumnName", renameColumnStatement.getNewColumnName());
if (database instanceof MySQLDatabase) {
validationErrors.checkRequiredField("columnDataType", renameColumnStatement.getColumnDataType());
}
return validationErrors;
}
示例13: validateSingleColumn
import liquibase.exception.ValidationErrors; //导入方法依赖的package包/类
private ValidationErrors validateSingleColumn(DropColumnStatement dropColumnStatement) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("tableName", dropColumnStatement.getTableName());
validationErrors.checkRequiredField("columnName", dropColumnStatement.getColumnName());
return validationErrors;
}
示例14: validate
import liquibase.exception.ValidationErrors; //导入方法依赖的package包/类
@Override
public ValidationErrors validate(TagDatabaseStatement tagDatabaseStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
ValidationErrors validationErrors = new ValidationErrors();
validationErrors.checkRequiredField("tag", tagDatabaseStatement.getTag());
return validationErrors;
}
示例15: validate
import liquibase.exception.ValidationErrors; //导入方法依赖的package包/类
@Override
public ValidationErrors validate(TruncateTableStatement truncateStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {
final ValidationErrors errors = new ValidationErrors();
errors.checkRequiredField("tableName", truncateStatement.getTableName());
return errors;
}