org.exolab.castor.jdo.oql

Class ParseTreeWalker

public class ParseTreeWalker extends Object implements TokenTypes

A class which walks the parse tree created by the parser to check for errors and translate to SQL.

Version: $Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:25 $

Author: Nissim Karpenstein

Field Summary
static intAGGREGATE
static intDEPENDANT_OBJECT
static intDEPENDANT_OBJECT_VALUE
static intDEPENDANT_VALUE
static intFUNCTION
static intMAX_TABLE_LENGTH
static intPARENT_OBJECT
Constructor Summary
ParseTreeWalker(LockEngine dbEngine, ParseTreeNode parseTree, ClassLoader classLoader)
Creates a new parse tree walker.
Method Summary
StringbuildTableAlias(String tableName, Vector path, int tableIndex)
Builds the alias name for a table from the path info.
JDOClassDescriptorgetClassDescriptor()
Accessor method for _clsDesc.
ClassgetObjClass()
Accessor method for _objClass.
HashtablegetParamInfo()
Accessor method for _paramInfo.
VectorgetPathInfo()
Method to get path info for the selected object.
intgetProjectionType()
Accessor method for _projectionType.
QueryExpressiongetQueryExpression()
Accessor method for private _queryExpr member.

Field Detail

AGGREGATE

public static final int AGGREGATE

DEPENDANT_OBJECT

public static final int DEPENDANT_OBJECT

DEPENDANT_OBJECT_VALUE

public static final int DEPENDANT_OBJECT_VALUE

DEPENDANT_VALUE

public static final int DEPENDANT_VALUE

FUNCTION

public static final int FUNCTION

MAX_TABLE_LENGTH

public static final int MAX_TABLE_LENGTH

PARENT_OBJECT

public static final int PARENT_OBJECT

Constructor Detail

ParseTreeWalker

public ParseTreeWalker(LockEngine dbEngine, ParseTreeNode parseTree, ClassLoader classLoader)
Creates a new parse tree walker. Which checks the tree for errors, and generates a QueryExpression containing the SQL translation.

Parameters: dbEngine The Persistence Engine parseTree The parse tree to walk

Throws: QueryException Thrown by checkErrors.

Method Detail

buildTableAlias

public String buildTableAlias(String tableName, Vector path, int tableIndex)
Builds the alias name for a table from the path info.

Parameters: tableName The name of the table to add to the select clause tableAlias The path info vector to build the alias with pathIndex Field index in the path info

getClassDescriptor

public JDOClassDescriptor getClassDescriptor()
Accessor method for _clsDesc.

Returns: The _clsDesc member.

getObjClass

public Class getObjClass()
Accessor method for _objClass.

Returns: The _objClass member.

getParamInfo

public Hashtable getParamInfo()
Accessor method for _paramInfo.

Returns: The _paramInfo member.

getPathInfo

public Vector getPathInfo()
Method to get path info for the selected object. This is the path which will be used by the QueryResults to follow the path if the object selected is a DEPENDANT_OBJECT or DEPENDANT_OBJECT_VALUE. Any other projectionTypes do not need this, so null will be returned.

getProjectionType

public int getProjectionType()
Accessor method for _projectionType.

Returns: The _projectionType member.

getQueryExpression

public QueryExpression getQueryExpression()
Accessor method for private _queryExpr member.

Returns: private _queryExpr member

Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com