class AlterTableSet extends SchemaStatement {

    private final Table table;
    private final int type;
    private final boolean value;
    private boolean checkExisting;

    public AlterTableSet(ServerSession session, Table table, int type, boolean value) {
        super(session, table.getSchema());
        this.table = table;
        this.type = type;
        this.value = value;
    }

    @Override
    public int getType() {
        return type;
    }

    public void setCheckExisting(boolean b) {
        this.checkExisting = b;
    }

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

        session.getUser().checkRight(table, Right.ALL);
        DbObjectLock lock = tryAlterTable(table);
        if (lock == null)
            return -1;

        switch (type) {
        case SQLStatement.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY:
            table.setCheckForeignKeyConstraints(session, value, value ? checkExisting : false);
            break;
        default:
            DbException.throwInternalError("type=" + type);
        }
        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