@Test public void validate_noAutoIncrementWithDerby() { ValidationErrors validationErrors = generatorUnderTest.validate(new AddColumnStatement(null, "table_name", "column_name", "int", null, new AutoIncrementConstraint("column_name")), new DerbyDatabase(), new MockSqlGeneratorChain()); assertTrue(validationErrors.getErrorMessages().contains("Cannot add an identity column to a database")); }
@Override public ValidationErrors validate(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { ValidationErrors validationErrors = super.validate(statement, database, sqlGeneratorChain); if (database instanceof DerbyDatabase && statement.isAutoIncrement()) { validationErrors.addError("Cannot add an identity column to a database"); } return validationErrors; }
AddColumnGeneratorDefaultClauseBeforeNotNull extends AddColumnGenerator { @Override public ValidationErrors validate(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { ValidationErrors validationErrors = super.validate(statement, database, sqlGeneratorChain); if (database instanceof DerbyDatabase && statement.isAutoIncrement()) { validationErrors.addError("Cannot add an identity column to a database"); } return validationErrors; } }
AddColumnGeneratorDefaultClauseBeforeNotNull extends AddColumnGenerator { @Override public ValidationErrors validate(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { ValidationErrors validationErrors = super.validate(statement, database, sqlGeneratorChain); if (database instanceof DerbyDatabase && statement.isAutoIncrement()) { validationErrors.addError("Cannot add an identity column to a database"); } return validationErrors; }  }
AddColumnGeneratorDefaultClauseBeforeNotNull extends AddColumnGenerator { @Override public ValidationErrors validate(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { ValidationErrors validationErrors = super.validate(statement, database, sqlGeneratorChain); if (database instanceof DerbyDatabase && statement.isAutoIncrement()) { validationErrors.addError("Cannot add an identity column to a database"); } return validationErrors; }  @Override int getPriority(); @Override boolean supports(AddColumnStatement statement, Database database); @Override ValidationErrors validate(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain); @Override Sql[] generateSql(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain); }
AddColumnGeneratorDefaultClauseBeforeNotNull extends AddColumnGenerator { @Override public ValidationErrors validate(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { ValidationErrors validationErrors = super.validate(statement, database, sqlGeneratorChain); if (database instanceof DerbyDatabase && statement.isAutoIncrement()) { validationErrors.addError("Cannot add an identity column to a database"); } return validationErrors; }  @Override int getPriority(); @Override boolean supports(AddColumnStatement statement, Database database); @Override ValidationErrors validate(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain); @Override Sql[] generateSql(AddColumnStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain);  }