org.eigenbase.oj.stmt
Class PreparedExplanation

java.lang.Object
  extended by org.eigenbase.oj.stmt.PreparedExplanation
All Implemented Interfaces:
PreparedResult

public class PreparedExplanation
extends Object
implements PreparedResult

PreparedExplanation is a PreparedResult for an EXPLAIN PLAN statement. It's always good to have an explanation prepared.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/oj/stmt/PreparedExplanation.java#16 $
Author:
John V. Sichi

Field Summary
private  boolean asXml
           
private  SqlExplainLevel detailLevel
           
private  RelNode rel
           
private  RelDataType rowType
           
 
Constructor Summary
PreparedExplanation(RelDataType rowType, RelNode rel, boolean asXml, SqlExplainLevel detailLevel)
           
 
Method Summary
 Object execute()
          Executes the prepared result.
static ResultSet executeStatic(String explanation)
           
 String getCode()
           
 RelNode getRel()
           
 TableModificationRelBase.Operation getTableModOp()
           
 boolean isDml()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowType

private final RelDataType rowType

rel

private final RelNode rel

asXml

private final boolean asXml

detailLevel

private final SqlExplainLevel detailLevel
Constructor Detail

PreparedExplanation

public PreparedExplanation(RelDataType rowType,
                           RelNode rel,
                           boolean asXml,
                           SqlExplainLevel detailLevel)
Method Detail

getCode

public String getCode()
Specified by:
getCode in interface PreparedResult
Returns:
the code generated by preparation

isDml

public boolean isDml()
Specified by:
isDml in interface PreparedResult
Returns:
true iff this result is for a DML statement, in which case the result set is one row with one column containing the number of rows affected.

getTableModOp

public TableModificationRelBase.Operation getTableModOp()
Specified by:
getTableModOp in interface PreparedResult
Returns:
the table modification operation corresponding to this statement if it is a table modification statement; otherwise null

getRel

public RelNode getRel()

execute

public Object execute()
Description copied from interface: PreparedResult
Executes the prepared result.

Specified by:
execute in interface PreparedResult
Returns:
producer of rows resulting from execution

executeStatic

public static ResultSet executeStatic(String explanation)