Class AESubQuery

  extended by com.simba.dsi.CppClassWrapper
      extended by com.simba.dsi.ext.aetree.AENode
          extended by com.simba.dsi.ext.aetree.AEQueryOperation
              extended by com.simba.dsi.ext.aetree.AERelationalExpr
                  extended by com.simba.dsi.ext.aetree.AENamedRelationalExpr
                      extended by com.simba.dsi.ext.aetree.AESubQuery

public class AESubQuery
extends AENamedRelationalExpr

This class does NOT represent any concrete relational expressions. It is designed to model a sub-query so that after the query optimization (which will manipulate the tree), a reference to a sub-query from an AEColumn object will still be valid.

For practical purpose, a sub-query is considered as a "unary" expression since a sub-query takes an AERelationalExpr object as the only operand.

The most important difference between an AEValueSubQuery an a relational AESubQuery is that an AEValueSubQuery returns exactly 1 value, and as such is treated like a value expression. An AESubQuery returns a result set of more than >= 1 value.

Constructor Summary
AESubQuery(long objRef, boolean isCorrelated, boolean isInFromClause)
Method Summary
 AERelationalExpr getOperand()
          Retrieves the relational operand.
 boolean isCorrelated()
          Tests whether the sub-query is correlated.
 boolean isInFromClause()
          Indicate if the sub-query is in the FROM clause of the outer query.
Methods inherited from class com.simba.dsi.ext.aetree.AENamedRelationalExpr
getCatalogName, getSchemaName, getTableName, isNamed
Methods inherited from class com.simba.dsi.ext.aetree.AEQueryOperation
getColumn, getColumnCount
Methods inherited from class com.simba.dsi.ext.aetree.AENode
getChild, getChildCount, getNodeType
Methods inherited from class com.simba.dsi.CppClassWrapper
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public AESubQuery(long objRef,
                  boolean isCorrelated,
                  boolean isInFromClause)

objRef - The corresponding C++ object reference.
isCorrelated - Indicate whether the sub-query is correlated.
isInFromClause - Indicate whether the sub-query is in the FROM clause of an outer query.
Method Detail


public AERelationalExpr getOperand()
Retrieves the relational operand.

The relational operand.


public boolean isCorrelated()
Tests whether the sub-query is correlated.

This function checks whether this value sub-query's query scope contains any columns that are not in the query scope's table symbols but are in the table symbols of the parent query scope. If this is the case, the current query scope is associated with a query that is correlated to the outer query (AKA 'correlated sub-query'). If this value sub-query's query scope does not contain any table symbols that are not in the query scope but are in the parent query scope, then it is an 'uncorrelated sub-query'.

True if this sub-query is correlated to the outer query; False if it is uncorrelated to the outer query.


public boolean isInFromClause()
Indicate if the sub-query is in the FROM clause of the outer query.

true if this sub-query is in the FROM clause, false otherwise.

Copyright © 2006-2014 Simba Technologies Incorporated. All Rights Reserved.