class AddDefaultValueGenerator extends AbstractSqlGenerator<AddDefaultValueStatement> {

    @Override
    public ValidationErrors validate(AddDefaultValueStatement addDefaultValueStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {<FILL_FUNCTION_BODY>}

    @Override
    public Warnings warn(AddDefaultValueStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
        Warnings warnings = super.warn(statement, database, sqlGeneratorChain);

        if (database instanceof MySQLDatabase) {
            ((MySQLDatabase) database).warnAboutAlterColumn("addDefaultValue", warnings);
        }

        return warnings;
    }

    @Override
    public Sql[] generateSql(AddDefaultValueStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
        Object defaultValue = statement.getDefaultValue();
        return new Sql[] {
                new UnparsedSql("ALTER TABLE "
                        + database.escapeTableName(
                                statement.getCatalogName(),
                                statement.getSchemaName(),
                                statement.getTableName() )
                        + " ALTER COLUMN  "
                        + database.escapeColumnName(
                                statement.getCatalogName(),
                                statement.getSchemaName(),
                                statement.getTableName(),
                                statement.getColumnName()
                        ) + " SET DEFAULT "
                        + DataTypeFactory.getInstance()
                            .fromObject(defaultValue, database)
                            .objectToSql(defaultValue, database),
                    getAffectedColumn(statement) )
        };
    }

    protected Column getAffectedColumn(AddDefaultValueStatement statement) {
        return new Column()
                .setRelation(new Table().setName(statement.getTableName()).setSchema(new Schema(statement.getCatalogName(), statement.getSchemaName())))
                .setName(statement.getColumnName());
    }
}

        Object defaultValue = addDefaultValueStatement.getDefaultValue();

        ValidationErrors validationErrors = new ValidationErrors();
        validationErrors.checkRequiredField("defaultValue", defaultValue, true);
        validationErrors.checkRequiredField("columnName", addDefaultValueStatement.getColumnName());
        validationErrors.checkRequiredField("tableName", addDefaultValueStatement.getTableName());
        if (!database.supports(Sequence.class) && (defaultValue instanceof SequenceNextValueFunction)) {
            validationErrors.addError("Database "+database.getShortName()+" does not support sequences");
        }
        if (database instanceof HsqlDatabase) {
            if (defaultValue instanceof SequenceNextValueFunction) {
                validationErrors.addError("Database " + database.getShortName() + " does not support adding sequence-based default values");
            } else if ((defaultValue instanceof DatabaseFunction) && !HsqlDatabase.supportsDefaultValueComputed
                (addDefaultValueStatement.getColumnDataType(), defaultValue.toString())) {
                validationErrors.addError("Database " + database.getShortName() + " does not support adding function-based default values");
            }
        }

        String columnDataType = addDefaultValueStatement.getColumnDataType();
        if (columnDataType != null) {
            LiquibaseDataType dataType = DataTypeFactory.getInstance().fromDescription(columnDataType, database);
            boolean typeMismatch = false;
            if (dataType instanceof BooleanType) {
                if (!(defaultValue instanceof Boolean) && !(defaultValue instanceof DatabaseFunction)) {
                    typeMismatch = true;
                }
            } else if (dataType instanceof CharType) {
                if (!(defaultValue instanceof String) && !(defaultValue instanceof DatabaseFunction)) {
                    typeMismatch = true;
                }
            }

            if (typeMismatch) {
                validationErrors.addError("Default value of "+defaultValue+" does not match defined type of "+columnDataType);
            }
        }

        return validationErrors;
    
<methods>public non-sealed void <init>() ,public boolean generateRollbackStatementsIsVolatile(liquibase.database.Database) ,public boolean generateStatementsIsVolatile(liquibase.database.Database) ,public int getPriority() ,public boolean looksLikeFunctionCall(java.lang.String, liquibase.database.Database) ,public boolean supports(liquibase.statement.core.AddDefaultValueStatement, liquibase.database.Database) ,public liquibase.exception.Warnings warn(liquibase.statement.core.AddDefaultValueStatement, liquibase.database.Database, SqlGeneratorChain<liquibase.statement.core.AddDefaultValueStatement>) <variables>