use of com.robotoworks.mechanoid.db.validation.StatementSequenceValidatorResult in project mechanoid by robotoworks.
the class StatementSequenceValidator method validate.
public StatementSequenceValidatorResult validate(final DatabaseBlock db) {
this.tables.clear();
this.views.clear();
this.triggers.clear();
this.indexes.clear();
StatementSequenceValidatorResult result = new StatementSequenceValidatorResult();
result.valid = true;
EList<MigrationBlock> _migrations = db.getMigrations();
for (final MigrationBlock migration : _migrations) {
{
EList<DDLStatement> statements = migration.getStatements();
for (final DDLStatement stmt : statements) {
{
result.source = stmt;
this.validateStatement(result, stmt);
if (result.valid) {
this.sequence(stmt);
} else {
return result;
}
}
}
}
}
return result;
}
Aggregations