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


Java ValidationErrors.checkRequiredField方法代码示例

本文整理汇总了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;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:22,代码来源:AddColumnGenerator.java

示例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;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:12,代码来源:AddAutoIncrementGenerator.java

示例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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:9,代码来源:HiveInsertGenerator.java

示例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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:HiveMarkChangeSetRanGenerator.java

示例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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:RenameTableGenerator.java

示例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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:SetGenerator.java

示例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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:8,代码来源:InsertAsSelectGenerator.java

示例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;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:13,代码来源:DropDefaultValueGenerator.java

示例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;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:13,代码来源:CreateViewGenerator.java

示例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;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:8,代码来源:SetColumnRemarksGenerator.java

示例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;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:9,代码来源:InsertOrUpdateGenerator.java

示例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;
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:13,代码来源:RenameColumnGenerator.java

示例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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:7,代码来源:HiveDropColumnGenerator.java

示例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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:7,代码来源:HiveTagDatabaseGenerator.java

示例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;
}
 
开发者ID:eselyavka,项目名称:liquibase-impala,代码行数:7,代码来源:TruncateGenerator.java


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