Package org.exolab.castor.jdo.oql
Class ParseTreeWalker
java.lang.Object
org.exolab.castor.jdo.oql.ParseTreeWalker
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionParseTreeWalker
(LockEngine dbEngine, ParseTreeNode parseTree, ClassLoader classLoader, DbMetaInfo dbInfo) Creates a new parse tree walker. -
Method Summary
Modifier and TypeMethodDescriptionbuildTableAlias
(String tableName, Vector<String> path, int tableIndex) Builds the alias name for a table from the path info.Accessor method for _clsDesc.Class
<?> Accessor method for _objClass.Accessor method for _paramInfo.Method to get path info for the selected object.int
Accessor method for _projectionType.Accessor method for private _queryExpr member.
-
Field Details
-
AGGREGATE
public static final int AGGREGATE- See Also:
-
FUNCTION
public static final int FUNCTION- See Also:
-
PARENT_OBJECT
public static final int PARENT_OBJECT- See Also:
-
DEPENDANT_OBJECT
public static final int DEPENDANT_OBJECT- See Also:
-
DEPENDANT_OBJECT_VALUE
public static final int DEPENDANT_OBJECT_VALUE- See Also:
-
DEPENDANT_VALUE
public static final int DEPENDANT_VALUE- See Also:
-
MAX_TABLE_LENGTH
public static final int MAX_TABLE_LENGTH- See Also:
-
-
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 EngineparseTree
- The parse tree to walkclassLoader
- A ClassLoader instance to load classes.- Throws:
QueryException
- Thrown by checkErrors.
-
-
Method Details
-
getObjClass
Accessor method for _objClass.- Returns:
- The _objClass member.
-
getProjectionType
public int getProjectionType()Accessor method for _projectionType.- Returns:
- The _projectionType member.
-
getQueryExpression
Accessor method for private _queryExpr member.- Returns:
- private _queryExpr member
-
getParamInfo
Accessor method for _paramInfo.- Returns:
- The _paramInfo member.
-
getClassDescriptor
Accessor method for _clsDesc.- Returns:
- The _clsDesc member.
-
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
Builds the alias name for a table from the path info.- Parameters:
tableName
- The name of the table to add to the select clausepath
- The path info vector to build the alias withtableIndex
- Field index in the path info- Returns:
- Alias name for a given table.
-