Class ExpressionCompiler
- java.lang.Object
-
- org.datanucleus.store.query.expression.ExpressionCompiler
-
public class ExpressionCompiler extends java.lang.ObjectCompiler for expressions. Responsible for taking a Node tree and creating an Expression tree.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<java.lang.String,java.lang.String>aliasByPrefix(package private) SymbolTablesymtbl
-
Constructor Summary
Constructors Constructor Description ExpressionCompiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ExpressioncompileAdditiveMultiplicativeExpression(Node node)ExpressioncompileExpression(Node node)Primary entry point for compiling a node for the filter, grouping, having, result clauses.ExpressioncompileFromExpression(Node node, boolean classIsExpression)Primary entry point for compiling a node for the from clause.private ExpressioncompileOrAndExpression(Node node)This method deals with the OR/AND conditions.ExpressioncompileOrderExpression(Node node)Primary entry point for compiling a node for the order clause.private ExpressioncompilePrimaryExpression(Node node)private ExpressioncompileRelationalExpression(Node node)private ExpressioncompileUnaryExpression(Node node)private java.util.List<Expression>getExpressionsForPropertiesOfNode(Node node)Convenience method to extract properties for this node and return the associated list of expressions.private booleanisOperator(Node node, java.lang.String operator)voidsetMethodAliases(java.util.Map<java.lang.String,java.lang.String> aliasByPrefix)voidsetSymbolTable(SymbolTable symtbl)
-
-
-
Field Detail
-
symtbl
SymbolTable symtbl
-
aliasByPrefix
java.util.Map<java.lang.String,java.lang.String> aliasByPrefix
-
-
Method Detail
-
setMethodAliases
public void setMethodAliases(java.util.Map<java.lang.String,java.lang.String> aliasByPrefix)
-
setSymbolTable
public void setSymbolTable(SymbolTable symtbl)
-
compileOrderExpression
public Expression compileOrderExpression(Node node)
Primary entry point for compiling a node for the order clause.- Parameters:
node- The node- Returns:
- Its compiled expression
-
compileFromExpression
public Expression compileFromExpression(Node node, boolean classIsExpression)
Primary entry point for compiling a node for the from clause.- Parameters:
node- The nodeclassIsExpression- whether the class of the from node is an expression relating to the outer query- Returns:
- Its compiled expression
-
compileExpression
public Expression compileExpression(Node node)
Primary entry point for compiling a node for the filter, grouping, having, result clauses.- Parameters:
node- The node- Returns:
- Its compiled expression
-
compileOrAndExpression
private Expression compileOrAndExpression(Node node)
This method deals with the OR/AND conditions. A condition specifies a combination of one or more expressions and logical (Boolean) operators and returns a value of TRUE, FALSE, or unknown- Parameters:
node- The Node to process
-
compileRelationalExpression
private Expression compileRelationalExpression(Node node)
-
compileAdditiveMultiplicativeExpression
private Expression compileAdditiveMultiplicativeExpression(Node node)
-
compileUnaryExpression
private Expression compileUnaryExpression(Node node)
-
compilePrimaryExpression
private Expression compilePrimaryExpression(Node node)
-
getExpressionsForPropertiesOfNode
private java.util.List<Expression> getExpressionsForPropertiesOfNode(Node node)
Convenience method to extract properties for this node and return the associated list of expressions.- Parameters:
node- The node- Returns:
- The list of expressions for the properties (or null if no properties)
-
isOperator
private boolean isOperator(Node node, java.lang.String operator)
-
-