org.eigenbase.sql.validate
Class JoinScope

java.lang.Object
  extended by org.eigenbase.sql.validate.DelegatingScope
      extended by org.eigenbase.sql.validate.ListScope
          extended by org.eigenbase.sql.validate.JoinScope
All Implemented Interfaces:
SqlValidatorScope

public class JoinScope
extends ListScope

The name-resolution context for expression inside a JOIN clause. The objects visible are the joined table expressions, and those inherited from the parent scope.

Consider "SELECT * FROM (A JOIN B ON {exp1}) JOIN C ON {exp2}". {exp1} is resolved in the join scope for "A JOIN B", which contains A and B but not C.

Since:
Mar 25, 2003
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/JoinScope.java#9 $
Author:
jhyde

Field Summary
private  SqlJoin join
           
private  SqlValidatorScope usingScope
           
 
Fields inherited from class org.eigenbase.sql.validate.ListScope
children, childrenNames
 
Fields inherited from class org.eigenbase.sql.validate.DelegatingScope
parent, validator
 
Constructor Summary
JoinScope(SqlValidatorScope parent, SqlValidatorScope usingScope, SqlJoin join)
          Creates a JoinScope.
 
Method Summary
 void addChild(SqlValidatorNamespace ns, String alias)
          Registers a relation in this scope.
 SqlNode getNode()
          Returns the root node of this scope.
 SqlValidatorScope getUsingScope()
          Returns the scope which is used for resolving USING clause.
 SqlWindow lookupWindow(String name)
          Finds a window with a given name.
 
Methods inherited from class org.eigenbase.sql.validate.ListScope
findAliases, findAllColumnNames, findQualifyingTableName, getChild, getChildren, resolve, resolveColumn
 
Methods inherited from class org.eigenbase.sql.validate.DelegatingScope
addColumnNames, fullyQualify, getMonotonicity, getOperandScope, getOrderList, getParent, getValidator, validateExpr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

usingScope

private final SqlValidatorScope usingScope

join

private final SqlJoin join
Constructor Detail

JoinScope

JoinScope(SqlValidatorScope parent,
          SqlValidatorScope usingScope,
          SqlJoin join)
Creates a JoinScope.

Parameters:
parent - Parent scope
usingScope - Scope for resolving USING clause
join - Call to JOIN operator
Method Detail

getNode

public SqlNode getNode()
Description copied from interface: SqlValidatorScope
Returns the root node of this scope.


addChild

public void addChild(SqlValidatorNamespace ns,
                     String alias)
Description copied from interface: SqlValidatorScope
Registers a relation in this scope.

Specified by:
addChild in interface SqlValidatorScope
Overrides:
addChild in class ListScope
Parameters:
ns - Namespace representing the result-columns of the relation
alias - Alias with which to reference the relation, must not be null

lookupWindow

public SqlWindow lookupWindow(String name)
Description copied from interface: SqlValidatorScope
Finds a window with a given name. Returns null if not found.

Specified by:
lookupWindow in interface SqlValidatorScope
Overrides:
lookupWindow in class DelegatingScope

getUsingScope

public SqlValidatorScope getUsingScope()
Returns the scope which is used for resolving USING clause.