Class ParseTreeWalker

java.lang.Object
org.exolab.castor.jdo.oql.ParseTreeWalker

public class ParseTreeWalker extends Object
A class which walks the parse tree created by the parser to check for errors and translate to SQL.
Version:
$Revision: 8459 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Author:
Nissim Karpenstein
  • Field Details

  • Constructor Details

    • ParseTreeWalker

      public ParseTreeWalker(LockEngine dbEngine, ParseTreeNode parseTree, ClassLoader classLoader, DbMetaInfo dbInfo) throws QueryException
      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
      classLoader - A ClassLoader instance to load classes.
      Throws:
      QueryException - Thrown by checkErrors.
  • Method Details

    • getObjClass

      public Class<?> getObjClass()
      Accessor method for _objClass.
      Returns:
      The _objClass member.
    • 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
    • getParamInfo

      public Hashtable<Integer,ParamInfo> getParamInfo()
      Accessor method for _paramInfo.
      Returns:
      The _paramInfo member.
    • getClassDescriptor

      public ClassDescriptor getClassDescriptor()
      Accessor method for _clsDesc.
      Returns:
      The _clsDesc member.
    • getProjectionInfo

      public Vector<String> getProjectionInfo()
      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.
      Returns:
      Path info for the selected element, null otherwise.
    • buildTableAlias

      public String buildTableAlias(String tableName, Vector<String> 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
      path - The path info vector to build the alias with
      tableIndex - Field index in the path info
      Returns:
      Alias name for a given table.