org.objectweb.jonas_ejb.lib
Class EjbqlVariableVisitor

java.lang.Object
  |
  +--org.objectweb.jonas_ejb.lib.EjbqlAbstractVisitor
        |
        +--org.objectweb.jonas_ejb.lib.EjbqlVariableVisitor
All Implemented Interfaces:
EJBQLVisitor

public class EjbqlVariableVisitor
extends EjbqlAbstractVisitor

Implementation of a visitor that creates a map of pairs [id,IdValue] for all defined identifiers of the query.

Author:
Christophe Ney [cney@batisseurs.com] contributor(s); - Helene Joanin: In the visit of the SELECT clause, do not forget to add the id in the ids structure if its not present. Indeed, the definition of this id is done in the FROM clause which is visited later. This is needed for ejbSelect query which allows path_expression in the SELECT clause. - Helene Joanin: Use of the NavigatorNodeFactory.getIn() for IN in the FROM part instead of NavigatorNodeFactory.getNavigatorNode()

Inner classes inherited from class org.objectweb.jonas_ejb.lib.EjbqlAbstractVisitor
EjbqlAbstractVisitor.IdValue, EjbqlAbstractVisitor.VisitorException
 
Constructor Summary
EjbqlVariableVisitor(ASTEJBQL ejbql, org.objectweb.jorm.metainfo.api.Schema schema)
          constructor
 
Method Summary
 java.lang.String[] getName(java.lang.String id)
          get the abstract schema name or collection values path of the given identifier.
 org.objectweb.medor.query.api.QueryTree getQueryTree()
          get the Map that was built from visiting the lexical query tree
 void traceIds(java.lang.String msg)
          trace the ids structure
 java.lang.Object visit(ASTAbstractSchemaName node, java.lang.Object data)
          Push the Node to the stack
 java.lang.Object visit(ASTArithmeticExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTArithmeticFactor node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTArithmeticTerm node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTBetweenExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTBooleanExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTCollectionMemberDeclaration node, java.lang.Object data)
          visit child nodes
 java.lang.Object visit(ASTCollectionMemberExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTCollectionValuedPathExpression node, java.lang.Object data)
          visit child nodes
 java.lang.Object visit(ASTComparisonExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTConditionalExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTConditionalFactor node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTConditionalTerm node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTDatetimeExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTEmptyCollectionComparisonExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTEntityBeanExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTFromClause node, java.lang.Object data)
          visit child nodes
 java.lang.Object visit(ASTFunctionsReturningNumerics node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTFunctionsReturningStrings node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTIdentificationVariable node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTIdentifier node, java.lang.Object data)
          store the pair identifier,Node from the Stack in HashMap
 java.lang.Object visit(ASTInExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTLikeExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTNullComparisonExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTPath node, java.lang.Object data)
          Push the Node to the stack
 java.lang.Object visit(ASTRangeVariableDeclaration node, java.lang.Object data)
          visit child nodes
 java.lang.Object visit(ASTSelectClause node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTSingleValuedNavigation node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTSingleValuedPathExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTStringExpression node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 java.lang.Object visit(ASTWhereClause node, java.lang.Object data)
          null implementation of the visit method for the corresponding parameter type
 
Methods inherited from class org.objectweb.jonas_ejb.lib.EjbqlAbstractVisitor
mergePath, mergePath, splitPath, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EjbqlVariableVisitor

public EjbqlVariableVisitor(ASTEJBQL ejbql,
                            org.objectweb.jorm.metainfo.api.Schema schema)
                     throws java.lang.Exception
constructor
Parameters:
ejbql - root of the lexical tree
schema - JORM schema on which the query applies
Method Detail

getName

public java.lang.String[] getName(java.lang.String id)
get the abstract schema name or collection values path of the given identifier.

getQueryTree

public org.objectweb.medor.query.api.QueryTree getQueryTree()
get the Map that was built from visiting the lexical query tree

traceIds

public void traceIds(java.lang.String msg)
trace the ids structure

visit

public java.lang.Object visit(ASTFromClause node,
                              java.lang.Object data)
visit child nodes
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTCollectionMemberDeclaration node,
                              java.lang.Object data)
visit child nodes
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTRangeVariableDeclaration node,
                              java.lang.Object data)
visit child nodes
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTCollectionValuedPathExpression node,
                              java.lang.Object data)
visit child nodes
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTAbstractSchemaName node,
                              java.lang.Object data)
Push the Node to the stack
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTIdentifier node,
                              java.lang.Object data)
store the pair identifier,Node from the Stack in HashMap
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTPath node,
                              java.lang.Object data)
Push the Node to the stack
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTSelectClause node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTIdentificationVariable node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTSingleValuedPathExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTWhereClause node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTSingleValuedNavigation node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTConditionalExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTConditionalTerm node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTConditionalFactor node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTBetweenExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTInExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTLikeExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTNullComparisonExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTEmptyCollectionComparisonExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTCollectionMemberExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTComparisonExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTArithmeticExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTArithmeticTerm node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTArithmeticFactor node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTStringExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTDatetimeExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTBooleanExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTEntityBeanExpression node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTFunctionsReturningStrings node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor

visit

public java.lang.Object visit(ASTFunctionsReturningNumerics node,
                              java.lang.Object data)
Description copied from class: EjbqlAbstractVisitor
null implementation of the visit method for the corresponding parameter type
Overrides:
visit in class EjbqlAbstractVisitor