class AlterSequence extends SchemaStatement {

    private Table table;
    private Sequence sequence;
    private Expression start;
    private Expression increment;
    private Boolean cycle;
    private Expression minValue;
    private Expression maxValue;
    private Expression cacheSize;
    private Boolean transactional;

    public AlterSequence(ServerSession session, Schema schema) {
        super(session, schema);
    }

    @Override
    public int getType() {
        return SQLStatement.ALTER_SEQUENCE;
    }

    public void setSequence(Sequence sequence) {
        this.sequence = sequence;
    }

    public void setColumn(Column column) {
        table = column.getTable();
        sequence = column.getSequence();
        if (sequence == null) {
            throw DbException.get(ErrorCode.SEQUENCE_NOT_FOUND_1, column.getSQL());
        }
    }

    public void setStartWith(Expression start) {
        this.start = start;
    }

    public void setIncrement(Expression increment) {
        this.increment = increment;
    }

    public void setCycle(Boolean cycle) {
        this.cycle = cycle;
    }

    public void setMinValue(Expression minValue) {
        this.minValue = minValue;
    }

    public void setMaxValue(Expression maxValue) {
        this.maxValue = maxValue;
    }

    public void setCacheSize(Expression cacheSize) {
        this.cacheSize = cacheSize;
    }

    public void setTransactional(boolean transactional) {
        this.transactional = transactional;
    }

    @Override
    public int update() {<FILL_FUNCTION_BODY>}

    private Long getLong(Expression expr) {
        return CreateSequence.getLong(session, expr);
    }
}

        if (table != null) {
            session.getUser().checkRight(table, Right.ALL);
        }
        sequence.tryLock(session, false);
        Sequence newSequence = sequence.copy();
        if (cycle != null) {
            newSequence.setCycle(cycle);
        }
        if (cacheSize != null) {
            long size = cacheSize.optimize(session).getValue(session).getLong();
            newSequence.setCacheSize(size);
        }
        if (transactional != null) {
            newSequence.setTransactional(transactional.booleanValue());
        }
        if (start != null || minValue != null || maxValue != null || increment != null) {
            Long startValue = getLong(start);
            Long min = getLong(minValue);
            Long max = getLong(maxValue);
            Long inc = getLong(increment);
            newSequence.modify(startValue, min, max, inc);
        }
        newSequence.setOldSequence(sequence);
        schema.update(session, newSequence, sequence.getOldRow(), sequence.getLock());
        sequence.unlockIfNotTransactional(session);
        return 0;
    
<methods>public void <init>(com.lealone.db.session.ServerSession, com.lealone.db.schema.Schema) <variables>protected final non-sealed com.lealone.db.schema.Schema schema