|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.rel.SaffronRel | +--net.sf.saffron.rel.jdbc.JdbcQuery
A JdbcQuery
is a relational expression whose source is a SQL
statement executed against a JDBC data source. It has result set calling convention
.
Field Summary | |
protected SaffronConnection |
connection
The expression which yields the connection object. |
DataSource |
dataSource
|
(package private) SqlDialect |
dialect
|
(package private) String |
queryString
For debug. |
(package private) SqlSelect |
sql
|
Fields inherited from class net.sf.saffron.rel.SaffronRel |
cluster, digest, id, rowType |
Constructor Summary | |
JdbcQuery(VolcanoCluster cluster,
SaffronType rowType,
SaffronConnection connection,
SqlDialect dialect,
SqlSelect sql,
DataSource dataSource)
Creates a JdbcQuery . |
Method Summary | |
Object |
clone()
|
PlanCost |
computeSelfCost(SaffronPlanner planner)
Returns the cost of this plan (not including children). |
protected SaffronType |
deriveRowType()
|
SaffronConnection |
getConnection()
|
CallingConvention |
getConvention()
Returns a value from CallingConvention . |
String |
getQualifier()
|
Object |
implement(RelImplementor implementor,
int ordinal)
Create a plan for this expression according to a calling convention. |
void |
onRegister(SaffronPlanner planner)
This method is called just before the expression is registered. |
static void |
register(SaffronPlanner planner)
Registers any special rules specific to this kind of relational expression. |
Methods inherited from class net.sf.saffron.rel.SaffronRel |
childrenAccept, computeDigest, explain, getChildExps, getCluster, getCorrelVariable, getId, getInput, getInputs, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRows, getRowType, getTable, getVariablesStopped, implementFieldAccess, isAccessTo, isDistinct, recomputeDigest, registerCorrelVariable, replaceInput, setCorrelVariable, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final DataSource dataSource
protected SaffronConnection connection
SqlDialect dialect
SqlSelect sql
String queryString
Constructor Detail |
public JdbcQuery(VolcanoCluster cluster, SaffronType rowType, SaffronConnection connection, SqlDialect dialect, SqlSelect sql, DataSource dataSource)
JdbcQuery
.
cluster
- VolcanoCluster
this relational expression
belongs toconnection
- a SaffronConnection
;
must also implement DataSource
, because that's how we will
acquire the JDBC connection;
if you are generating code, the must have registered the connection
with OJConnectionRegistry
sql
- SQL parse tree, may be null, otherwise must be a SELECT
statementdataSource
- Provides a JDBC connection to run this query against.
If the query is implementing a JDBC table, then the connection's
schema will implement JdbcSchema
, and
data source will typically be the same as calling
JdbcSchema.getDataSource(net.sf.saffron.core.SaffronConnection)
. But non-JDBC
schemas are also acceptable.Method Detail |
public SaffronConnection getConnection()
public CallingConvention getConvention()
SaffronRel
CallingConvention
.
getConvention
in class SaffronRel
public String getQualifier()
getQualifier
in class SaffronRel
public Object clone()
clone
in class SaffronRel
public PlanCost computeSelfCost(SaffronPlanner planner)
SaffronRel
computeSelfCost
in class SaffronRel
public void onRegister(SaffronPlanner planner)
SaffronRel
onRegister
in class SaffronRel
public static void register(SaffronPlanner planner)
SaffronRel
The planner calls this method this first time that it sees a relational
expression of this class. The derived class should call SaffronPlanner.addRule(net.sf.saffron.opt.VolcanoRule)
for each rule, and then call SaffronRel.register(net.sf.saffron.core.SaffronPlanner)
on its base class.
public Object implement(RelImplementor implementor, int ordinal)
SaffronRel
implement
in class SaffronRel
implementor
- implementorordinal
- 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
i
th child.protected SaffronType deriveRowType()
deriveRowType
in class SaffronRel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |