net.sf.saffron.ext
Class JdbcTable

java.lang.Object
  |
  +--net.sf.saffron.ext.AbstractTable
        |
        +--net.sf.saffron.ext.JdbcTable
All Implemented Interfaces:
ImplementableTable, SaffronTable

public class JdbcTable
extends AbstractTable
implements ImplementableTable

A JdbcTable implements SaffronTable by connecting to a JDBC database.

Since:
10 November, 2001
Version:
$Id: //open/saffron/src/net/sf/saffron/ext/JdbcTable.java#3 $
Author:
jhyde

Nested Class Summary
static class JdbcTable.JdbcColumn
          JdbcColumn records the mapping of fields onto columns, for the purposes of SQL generation.
 
Field Summary
(package private)  JdbcTable.JdbcColumn[] columns
           
 
Fields inherited from class net.sf.saffron.ext.AbstractTable
name, rowType, schema
 
Constructor Summary
JdbcTable(SaffronSchema schema, String name, SaffronType rowType)
           
JdbcTable(SaffronSchema schema, String name, SaffronType rowType, JdbcTable.JdbcColumn[] columns)
           
 
Method Summary
 JdbcTable.JdbcColumn getColumn(String fieldName)
          Returns the column that the named field maps to.
 void implement(SaffronRel rel, RelImplementor implementor)
           
 SaffronRel toRel(VolcanoCluster cluster, SaffronConnection connection)
          Converts this table into a relational expression.
 
Methods inherited from class net.sf.saffron.ext.AbstractTable
getName, getQualifiedName, getRowCount, getRowType, getSaffronSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.saffron.core.SaffronTable
getQualifiedName, getRowCount, getRowType, getSaffronSchema
 

Field Detail

columns

JdbcTable.JdbcColumn[] columns
Constructor Detail

JdbcTable

public JdbcTable(SaffronSchema schema,
                 String name,
                 SaffronType rowType,
                 JdbcTable.JdbcColumn[] columns)

JdbcTable

public JdbcTable(SaffronSchema schema,
                 String name,
                 SaffronType rowType)
Method Detail

getColumn

public JdbcTable.JdbcColumn getColumn(String fieldName)
Returns the column that the named field maps to.


implement

public void implement(SaffronRel rel,
                      RelImplementor implementor)
Specified by:
implement in interface ImplementableTable

toRel

public SaffronRel toRel(VolcanoCluster cluster,
                        SaffronConnection connection)
Description copied from interface: SaffronTable
Converts this table into a relational expression.

The planner calls this method to convert a table into an initial relational expression, generally something abstract, such as a TableAccessRel, then optimizes this expression by applying rules to transform it into more efficient access methods for this table.

Specified by:
toRel in interface SaffronTable
Parameters:
cluster - the cluster the relational expression will belong to
connection - the parse tree of the expression which evaluates to a connection object

SourceForge.net_Logo