AESubQuery Class Reference

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. More...

Inherits AEUnaryExprT< AENamedRelationalExpr, AERelationalExpr >.

List of all members.

Public Member Functions

virtual void AcceptVisitor (AENodeVisitor &in_visitor)
 Calls the correct method on the visitor.
 AESubQuery (const AESubQuery &in_other)
 Copy constructor.
 AESubQuery (AutoPtr< AERelationalExpr > in_operand, const simba_wstring &in_corName, bool in_isCorrelated, bool in_isInFromClause=false)
 Constructor.
virtual AESubQueryClone () const
 Creates a clone of this node object.
virtual void EvaluateUseCaching ()
 Evaluate if this node, or children nodes, should use caching.
virtual const AESubQueryGetAsSubQuery () const
 Retrieves the object as an AESubQuery object.
virtual AESubQueryGetAsSubQuery ()
 Retrieves the object as an AESubQuery object.
virtual void GetCatalogName (simba_wstring &out_catalogName)
 Get the table catalog.
virtual simba_uint16 GetColumnCount ()
 Returns the number of columns in this query operation.
virtual simba_wstring GetLogString () const
 Returns a string name for this node for the purpose of logging.
virtual AENodeType GetNodeType () const
 Returns an integer that uniquely identifies the node class.
virtual void GetSchemaName (simba_wstring &out_schemaName)
 Get the table schema. This method always returns an empty string since a sub-query will never have a schema.
virtual void GetTableName (simba_wstring &out_tableName)
 Get the table name.
bool IsCorrelated () const
 Tests whether the sub-query is correlated.
bool IsInFromClause () const
 Indicate if the sub-query is in the FROM clause.
virtual void SetDataNeeded (simba_uint16 in_column, bool in_isNeeded)
 Indicates whether RetrieveData(...) might be called on the given column. This applies to any subsequent Move(...) calls.
virtual ~AESubQuery ()
 Destructor.

Detailed Description

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 one value. Another difference is that a relational sub-query can be renamed, as specified by an optional [AS corname] clause. An AEValueSubQuery cannot be renamed.

Will always have one child (GetChildCount() returns 1):


Constructor & Destructor Documentation

AESubQuery ( AutoPtr< AERelationalExpr in_operand,
const simba_wstring in_corName,
bool  in_isCorrelated,
bool  in_isInFromClause = false 
)

Constructor.

Parameters:
in_operand The relational expression as a sub-query. (OWN)
in_corName The correlation name for the sub-query.
in_isCorrelated True if this sub-query is correlated to the outer query; false if it is uncorrelated.
in_isInFromClause True if the sub-query is in the from clause; false otherwise.
Exceptions:
SEInvalidArgumentException when m_subQuery does not own an object
AESubQuery ( const AESubQuery in_other  ) 

Copy constructor.

To support "cloning". See Clone() method.

Parameters:
in_other The other node to create copy from.
virtual ~AESubQuery (  )  [virtual]

Destructor.


Member Function Documentation

virtual void AcceptVisitor ( AENodeVisitor in_visitor  )  [virtual]

Calls the correct method on the visitor.

Parameters:
in_visitor The visiting object.

Implements AENode.

virtual AESubQuery* Clone (  )  const [virtual]

Creates a clone of this node object.

Returns:
A clone of this node object. (OWN)

Implements AENamedRelationalExpr.

virtual void EvaluateUseCaching (  )  [virtual]

Evaluate if this node, or children nodes, should use caching.

Reimplemented from AERelationalExpr.

virtual const AESubQuery* GetAsSubQuery (  )  const [virtual]

Retrieves the object as an AESubQuery object.

Overrides the method defined in AERelationalExpr.

Returns:
This object always. (NOT OWN)

Reimplemented from AERelationalExpr.

virtual AESubQuery* GetAsSubQuery (  )  [virtual]

Retrieves the object as an AESubQuery object.

Overrides the method defined in AERelationalExpr.

Returns:
This object always. (NOT OWN)

Reimplemented from AERelationalExpr.

virtual void GetCatalogName ( simba_wstring out_catalogName  )  [virtual]

Get the table catalog.

This method always returns an empty string since a sub-query will never have a catalog.

Parameters:
out_catalogName The output table catalog.

Implements AENamedRelationalExpr.

virtual simba_uint16 GetColumnCount (  )  [virtual]

Returns the number of columns in this query operation.

Returns:
The number of columns in this query operation.

Implements AEQueryOperation.

virtual simba_wstring GetLogString (  )  const [virtual]

Returns a string name for this node for the purpose of logging.

Returns:
A string representation of this node for logging purposes.

Implements AENode.

virtual AENodeType GetNodeType (  )  const [virtual]

Returns an integer that uniquely identifies the node class.

See the definition of AENodeType for values defined.

Returns:
The ID that uniquely identifies this type of nodes.

Implements AENode.

virtual void GetSchemaName ( simba_wstring out_schemaName  )  [virtual]

Get the table schema. This method always returns an empty string since a sub-query will never have a schema.

Parameters:
out_schemaName The output table schema.

Implements AENamedRelationalExpr.

virtual void GetTableName ( simba_wstring out_tableName  )  [virtual]

Get the table name.

Parameters:
out_tableName The output table name for the value expression.

Implements AENamedRelationalExpr.

bool IsCorrelated (  )  const

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'.

Returns:
True if this sub-query is correlated to the outer query; False if it is uncorrelated to the outer query.
bool IsInFromClause (  )  const

Indicate if the sub-query is in the FROM clause.

Returns:
True if this sub-query is in the FROM clause; false otherwise.
virtual void SetDataNeeded ( simba_uint16  in_column,
bool  in_isNeeded 
) [virtual]

Indicates whether RetrieveData(...) might be called on the given column. This applies to any subsequent Move(...) calls.

Parameters:
in_column A zero-based column index.
in_isNeeded Indicates whether data may be retrieved from the given column by the ODBC layer or not.
Exceptions:
SEInvalidArgumentException if in_column is invalid.

Implements AERelationalExpr.


The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:17 2017 for SimbaEngine 10.1.3.1011 by simba