/**
   * Generate the code.
   *
   * @exception StandardException Thrown on error
   */
  public void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException {

    /* Get the next ResultSet #, so that we can number this ResultSetNode, its
     * ResultColumnList and ResultSet.
     */
    assignResultSetNumber();

    // Get our final cost estimate based on the child estimates.
    costEstimate = getFinalCostEstimate();

    // build up the tree.

    /* Generate the SetOpResultSet. Arguments:
     *  1) expression for left child ResultSet
     *  2) expression for right child ResultSet
     *  3) activation
     *  4) resultSetNumber
     *  5) estimated row count
     *  6) estimated cost
     *  7) opType
     *  8) all
     *  9) intermediateOrderByColumns saved object index
     *  10) intermediateOrderByDirection saved object index
     *  11) intermediateOrderByNullsLow saved object index
     */

    acb.pushGetResultSetFactoryExpression(mb); // instance for getSetOpResultSet

    getLeftResultSet().generate(acb, mb);
    getRightResultSet().generate(acb, mb);

    acb.pushThisAsActivation(mb);
    mb.push(resultSetNumber);
    mb.push(costEstimate.getEstimatedRowCount());
    mb.push(costEstimate.getEstimatedCost());
    mb.push(getOpType());
    mb.push(all);
    mb.push(getCompilerContext().addSavedObject(intermediateOrderByColumns));
    mb.push(getCompilerContext().addSavedObject(intermediateOrderByDirection));
    mb.push(getCompilerContext().addSavedObject(intermediateOrderByNullsLow));

    mb.callMethod(
        VMOpcode.INVOKEINTERFACE, (String) null, "getSetOpResultSet", ClassName.NoPutResultSet, 11);
  } // end of generate