saffron.sql
Class JdbcQuery

java.lang.Object
  |
  +--saffron.rel.Rel
        |
        +--saffron.sql.JdbcQuery

public class JdbcQuery
extends Rel

A JdbcQuery is a relational expression whose source is a SQL statement executed against a JDBC data source. It has result set calling convention.

Since:
2 August, 2002
Version:
$Id: //open/saffron/src/main/saffron/sql/JdbcQuery.java#5 $
Author:
jhyde

Nested Class Summary
 
Nested classes inherited from class saffron.rel.Rel
 
Field Summary
(package private)  Expression connectionExp
          The expression which yields the connection object.
(package private)  SqlDialect dialect
           
(package private)  String queryString
          For debug.
(package private)  SqlSelect sql
           
 
Fields inherited from class saffron.rel.Rel
cluster, digest, id, rowType
 
Constructor Summary
JdbcQuery(Cluster cluster, Type rowType, Expression connectionExp, SqlDialect dialect, SqlSelect sql)
          Creates a JdbcQuery.
 
Method Summary
 Object clone()
           
 Cost computeSelfCost(Planner planner)
          Returns the cost of this plan (not including children).
protected  Type deriveRowType()
           
 CallingConvention getConvention()
          Returns a value from CallingConvention.
 String getQualifier()
           
 Object implement(Implementor implementor, int ordinal)
          Create a plan for this expression according to a calling convention.
 void onRegister(Planner planner)
          This method is called just before the expression is registered.
static void register(Planner planner)
          Registers any special rules specific to this kind of relational expression.
 
Methods inherited from class saffron.rel.Rel
childrenAccept, computeDigest, explain, getChildExps, getCluster, getCorelVariable, getEnvironment, getId, getInput, getInputs, getOrCreateCorelVariable, getParentEnv, getQuery, getRelTypeName, getRows, getRowType, getTable, getType, getVariablesStopped, implementExp, implementExps, implementFieldAccess, implementSelf, isAccessTo, isDistinct, recomputeDigest, registerCorelVariable, replaceInput, setCorelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connectionExp

Expression connectionExp
The expression which yields the connection object.


dialect

SqlDialect dialect

sql

SqlSelect sql

queryString

String queryString
For debug. Set on register.

Constructor Detail

JdbcQuery

public JdbcQuery(Cluster cluster,
                 Type rowType,
                 Expression connectionExp,
                 SqlDialect dialect,
                 SqlSelect sql)
Creates a JdbcQuery.

Parameters:
cluster - Cluster this relational expression belongs to
Method Detail

clone

public Object clone()
Specified by:
clone in class Rel

getQualifier

public String getQualifier()
Overrides:
getQualifier in class Rel

getConvention

public CallingConvention getConvention()
Description copied from class: Rel
Returns a value from CallingConvention.

Overrides:
getConvention in class Rel

deriveRowType

protected Type deriveRowType()
Specified by:
deriveRowType in class Rel

computeSelfCost

public Cost computeSelfCost(Planner planner)
Description copied from class: Rel
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.

Overrides:
computeSelfCost in class Rel

onRegister

public void onRegister(Planner planner)
Description copied from class: Rel
This method is called just before the expression is registered. The implementation of this method must at least register all child expressions.

Overrides:
onRegister in class Rel

register

public static void register(Planner planner)
Description copied from class: Rel
Registers any special rules specific to this kind of relational expression.

The planner calls this method this first time that it sees a relational expression of this class. The derived class should call Planner.addRule(saffron.opt.Rule) for each rule, and then call Rel.register(saffron.Planner) on its base class.


implement

public Object implement(Implementor implementor,
                        int ordinal)
Description copied from class: Rel
Create a plan for this expression according to a calling convention.

Overrides:
implement in class Rel
Parameters:
implementor - implementor
ordinal - indicates our position in the pre-, in- and postfix walk over the tree; ordinal is -1 when called from the parent, and i when called from the ith child.

SourceForge.net_Logo