Quadcap Embeddable Database

com.quadcap.sql.JoinedTable Class Reference

Inheritance diagram for com.quadcap.sql.JoinedTable:

com.quadcap.sql.TableExpression Externalizable com.quadcap.sql.Expression List of all members.

Detailed Description

A table expression representing a single join operation.

Author:
Stan Bailes

Definition at line 64 of file JoinedTable.java.

Public Member Functions

 JoinedTable ()
 Default public constructor.

 JoinedTable (int op, TableExpression a, TableExpression b)
 Either a cross join or a natural join over any common columns.

void setOnExpression (Expression on)
 Join 'ON' on.

void setUsingList (Vector usingList)
 Join 'USING' column list.

void checkSyntax () throws RecognitionException
 Verify the correctness of the join expression -- the grammar can't catch all of the possible errors.

void setWhere (Expression where)
 Override base method to propagate to base tables.

int rank ()
 Returns zero if this is a scalar expression, one if it's a vector type and 2 if it's a table/cursor type.

boolean isUpdatable ()
 Is this table expression updatable?

void getBaseTables (Vector v)
 Return a vector consisting of the names of the underlying base tables that are used to derive this table expression.

void visitSubExpressions (ExpressionVisitor ev)
 Give a visitor access to the parse tree.

Cursor getCursor (Session session, Cursor outer) throws SQLException
 Return a cursor which can be used to access this table expression.

void readExternal (ObjectInput in) throws IOException, ClassNotFoundException
void writeExternal (ObjectOutput out) throws IOException
String toString ()
String name ()

Package Functions

String toString (Iterator iter)
Cursor getCrossCursor (Session session, Cursor outer, Cursor ca, Cursor cb, Expression where, Tuple jt, JoinMapRow jrl, boolean left, boolean inner) throws SQLException
int[][] getUsingColumns (Tuple a, Tuple b) throws SQLException
void getNaturalJoinColumns (Tuple ta, Tuple tb) throws SQLException

Static Package Functions

String isa (Object x)

Package Attributes

int op = -1
TableExpression a = null
TableExpression b = null
Tuple tuple = null
Expression onExpression = null
Vector usingList = null
 Vector<String> *.


Private Member Functions

final Tuple mapColumns (Tuple ra, Tuple rb, int[] map, boolean left) throws SQLException
 Build the tuple for this join operation.


Constructor & Destructor Documentation

com.quadcap.sql.JoinedTable.JoinedTable  ) 
 

Default public constructor.

Definition at line 76 of file JoinedTable.java.

com.quadcap.sql.JoinedTable.JoinedTable int  op,
TableExpression  a,
TableExpression  b
 

Either a cross join or a natural join over any common columns.

Definition at line 81 of file JoinedTable.java.


Member Function Documentation

void com.quadcap.sql.JoinedTable.checkSyntax  )  throws RecognitionException
 

Verify the correctness of the join expression -- the grammar can't catch all of the possible errors.

Definition at line 122 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.onExpression, com.quadcap.sql.JoinedTable.op, and com.quadcap.sql.JoinedTable.usingList.

Referenced by com.quadcap.sql.SQLParser.joinedTable().

void com.quadcap.sql.JoinedTable.getBaseTables Vector  v  )  [virtual]
 

Return a vector consisting of the names of the underlying base tables that are used to derive this table expression.

Implements com.quadcap.sql.TableExpression.

Definition at line 161 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.a, com.quadcap.sql.JoinedTable.b, com.quadcap.sql.TableExpression.getBaseTables(), and com.quadcap.sql.JoinedTable.getBaseTables().

Referenced by com.quadcap.sql.JoinedTable.getBaseTables().

Cursor com.quadcap.sql.JoinedTable.getCrossCursor Session  session,
Cursor  outer,
Cursor  ca,
Cursor  cb,
Expression  where,
Tuple  jt,
JoinMapRow  jrl,
boolean  left,
boolean  inner
throws SQLException [package]
 

Definition at line 264 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.getCrossCursor(), com.quadcap.sql.JoinedTable.getUsingColumns(), and com.quadcap.sql.JoinedTable.usingList.

Referenced by com.quadcap.sql.JoinedTable.getCrossCursor(), and com.quadcap.sql.JoinedTable.getCursor().

Cursor com.quadcap.sql.JoinedTable.getCursor Session  session,
Cursor  outer
throws SQLException [virtual]
 

Return a cursor which can be used to access this table expression.

Implements com.quadcap.sql.TableExpression.

Definition at line 185 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.a, com.quadcap.sql.MultiCursor.appendCursor(), com.quadcap.sql.JoinedTable.b, com.quadcap.sql.Tuple.getColumnCount(), com.quadcap.sql.JoinedTable.getCrossCursor(), com.quadcap.sql.TableExpression.getCursor(), com.quadcap.sql.JoinedTable.getCursor(), com.quadcap.sql.JoinedTable.getNaturalJoinColumns(), com.quadcap.sql.JoinedTable.mapColumns(), com.quadcap.sql.JoinedTable.onExpression, com.quadcap.sql.JoinedTable.op, and com.quadcap.sql.JoinedTable.usingList.

Referenced by com.quadcap.sql.JoinedTable.getCursor().

void com.quadcap.sql.JoinedTable.getNaturalJoinColumns Tuple  ta,
Tuple  tb
throws SQLException [package]
 

Definition at line 304 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.getNaturalJoinColumns(), com.quadcap.sql.Column.getShortName(), and com.quadcap.sql.JoinedTable.usingList.

Referenced by com.quadcap.sql.JoinedTable.getCursor(), and com.quadcap.sql.JoinedTable.getNaturalJoinColumns().

int [][] com.quadcap.sql.JoinedTable.getUsingColumns Tuple  a,
Tuple  b
throws SQLException [package]
 

Definition at line 288 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.a, com.quadcap.sql.JoinedTable.b, com.quadcap.sql.Column.getColumn(), com.quadcap.sql.JoinedTable.getUsingColumns(), and com.quadcap.sql.JoinedTable.usingList.

Referenced by com.quadcap.sql.JoinedTable.getCrossCursor(), and com.quadcap.sql.JoinedTable.getUsingColumns().

String com.quadcap.sql.JoinedTable.isa Object  x  )  [static, package]
 

Definition at line 180 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.isa().

Referenced by com.quadcap.sql.JoinedTable.isa().

boolean com.quadcap.sql.JoinedTable.isUpdatable  )  [virtual]
 

Is this table expression updatable?

Implements com.quadcap.sql.TableExpression.

Definition at line 159 of file JoinedTable.java.

final Tuple com.quadcap.sql.JoinedTable.mapColumns Tuple  ra,
Tuple  rb,
int[]  map,
boolean  left
throws SQLException [private]
 

Build the tuple for this join operation.

Definition at line 322 of file JoinedTable.java.

References com.quadcap.sql.TupleImpl.addColumn(), com.quadcap.sql.Column.getColumn(), com.quadcap.sql.Tuple.getColumn(), com.quadcap.sql.Column.getName(), com.quadcap.sql.Column.getShortName(), com.quadcap.sql.Column.getType(), com.quadcap.sql.Tuple.mapColumns(), com.quadcap.sql.JoinedTable.mapColumns(), com.quadcap.sql.Column.setJoinColumn(), and com.quadcap.sql.JoinedTable.usingList.

Referenced by com.quadcap.sql.JoinedTable.getCursor(), and com.quadcap.sql.JoinedTable.mapColumns().

String com.quadcap.sql.JoinedTable.name  )  [virtual]
 

Implements com.quadcap.sql.TableExpression.

Definition at line 403 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.a, com.quadcap.sql.JoinedTable.b, com.quadcap.sql.TableExpression.name(), and com.quadcap.sql.JoinedTable.op.

int com.quadcap.sql.JoinedTable.rank  )  [virtual]
 

Returns zero if this is a scalar expression, one if it's a vector type and 2 if it's a table/cursor type.

Implements com.quadcap.sql.TableExpression.

Definition at line 157 of file JoinedTable.java.

void com.quadcap.sql.JoinedTable.readExternal ObjectInput  in  )  throws IOException, ClassNotFoundException
 

Definition at line 372 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.readExternal().

Referenced by com.quadcap.sql.JoinedTable.readExternal().

void com.quadcap.sql.JoinedTable.setOnExpression Expression  on  ) 
 

Join 'ON' on.

Definition at line 90 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.setOnExpression().

Referenced by com.quadcap.sql.JoinedTable.setOnExpression().

void com.quadcap.sql.JoinedTable.setUsingList Vector  usingList  ) 
 

Join 'USING' column list.

Definition at line 97 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.setUsingList().

Referenced by com.quadcap.sql.JoinedTable.setUsingList().

void com.quadcap.sql.JoinedTable.setWhere Expression  where  ) 
 

Override base method to propagate to base tables.

Reimplemented from com.quadcap.sql.TableExpression.

Definition at line 151 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.a, com.quadcap.sql.JoinedTable.b, com.quadcap.sql.TableExpression.setWhere(), and com.quadcap.sql.JoinedTable.setWhere().

Referenced by com.quadcap.sql.JoinedTable.setWhere().

String com.quadcap.sql.JoinedTable.toString  )  [virtual]
 

Implements com.quadcap.sql.Expression.

Definition at line 390 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.a, com.quadcap.sql.JoinedTable.b, com.quadcap.sql.JoinedTable.op, and com.quadcap.sql.Expression.toString().

String com.quadcap.sql.JoinedTable.toString Iterator  iter  )  [package]
 

Definition at line 171 of file JoinedTable.java.

void com.quadcap.sql.JoinedTable.visitSubExpressions ExpressionVisitor  ev  ) 
 

Give a visitor access to the parse tree.

Reimplemented from com.quadcap.sql.Expression.

Definition at line 166 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.a, com.quadcap.sql.JoinedTable.b, com.quadcap.sql.ExpressionVisitor.visit(), and com.quadcap.sql.JoinedTable.visitSubExpressions().

Referenced by com.quadcap.sql.JoinedTable.visitSubExpressions().

void com.quadcap.sql.JoinedTable.writeExternal ObjectOutput  out  )  throws IOException
 

Definition at line 382 of file JoinedTable.java.

References com.quadcap.sql.JoinedTable.a, com.quadcap.sql.JoinedTable.b, com.quadcap.sql.JoinedTable.onExpression, com.quadcap.sql.JoinedTable.op, com.quadcap.sql.JoinedTable.usingList, and com.quadcap.sql.JoinedTable.writeExternal().

Referenced by com.quadcap.sql.JoinedTable.writeExternal().


Member Data Documentation

TableExpression com.quadcap.sql.JoinedTable.a = null [package]
 

Definition at line 66 of file JoinedTable.java.

Referenced by com.quadcap.sql.JoinedTable.getBaseTables(), com.quadcap.sql.JoinedTable.getCursor(), com.quadcap.sql.JoinedTable.getUsingColumns(), com.quadcap.sql.JoinedTable.name(), com.quadcap.sql.JoinedTable.setWhere(), com.quadcap.sql.JoinedTable.toString(), com.quadcap.sql.JoinedTable.visitSubExpressions(), and com.quadcap.sql.JoinedTable.writeExternal().

TableExpression com.quadcap.sql.JoinedTable.b = null [package]
 

Definition at line 67 of file JoinedTable.java.

Referenced by com.quadcap.sql.JoinedTable.getBaseTables(), com.quadcap.sql.JoinedTable.getCursor(), com.quadcap.sql.JoinedTable.getUsingColumns(), com.quadcap.sql.JoinedTable.name(), com.quadcap.sql.JoinedTable.setWhere(), com.quadcap.sql.JoinedTable.toString(), com.quadcap.sql.JoinedTable.visitSubExpressions(), and com.quadcap.sql.JoinedTable.writeExternal().

Expression com.quadcap.sql.JoinedTable.onExpression = null [package]
 

Definition at line 69 of file JoinedTable.java.

Referenced by com.quadcap.sql.JoinedTable.checkSyntax(), com.quadcap.sql.JoinedTable.getCursor(), and com.quadcap.sql.JoinedTable.writeExternal().

int com.quadcap.sql.JoinedTable.op = -1 [package]
 

Definition at line 65 of file JoinedTable.java.

Referenced by com.quadcap.sql.JoinedTable.checkSyntax(), com.quadcap.sql.JoinedTable.getCursor(), com.quadcap.sql.JoinedTable.name(), com.quadcap.sql.JoinedTable.toString(), and com.quadcap.sql.JoinedTable.writeExternal().

Tuple com.quadcap.sql.JoinedTable.tuple = null [package]
 

Definition at line 68 of file JoinedTable.java.

Vector com.quadcap.sql.JoinedTable.usingList = null [package]
 

Vector<String> *.

Definition at line 71 of file JoinedTable.java.

Referenced by com.quadcap.sql.JoinedTable.checkSyntax(), com.quadcap.sql.JoinedTable.getCrossCursor(), com.quadcap.sql.JoinedTable.getCursor(), com.quadcap.sql.JoinedTable.getNaturalJoinColumns(), com.quadcap.sql.JoinedTable.getUsingColumns(), com.quadcap.sql.JoinedTable.mapColumns(), and com.quadcap.sql.JoinedTable.writeExternal().