Class NodeFactoryImpl
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.parsing.NodeFactoryImpl
-
- All Implemented Interfaces:
NodeFactory
public class NodeFactoryImpl extends Object implements NodeFactory
INTERNALPurpose: Implements a node factory used by the EJBQLParser class.
Responsibilities:
- Create EJBQLParseTree instances for EJBQL SELECT-, UPDATE- and DELETE statements (see methods newSelectStatement, newUpdateStatement and newDeleteStatement).
- Any new<XXX> method returns an instance of the appropriate Node subclass.
- The relationship to the child nodes passed as arguments are automatically initialized.
- Note, this implementation has a state managing the parse tree context and a list of parameter names for the current parse tree. This state needs to be initialized before the same node factory implementation instance may be used to create a second parse tree (see methods initContext and initParameters).
- The implementation automatically adds the list of parameters to the created parse tree.
- The implementation automatically sets the parse tree context for any created major node.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.persistence.internal.jpa.parsing.NodeFactory
NodeFactory.TrimSpecification
-
-
Constructor Summary
Constructors Constructor Description NodeFactoryImpl(String queryInfo)
No-arg Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
newAbs(int line, int column, Object arg)
Object
newAll(int line, int column, Object subquery)
Object
newAnd(int line, int column, Object left, Object right)
Object
newAny(int line, int column, Object subquery)
Object
newAscOrdering(int line, int column, Object arg)
Object
newAttribute(int line, int column, String identifier)
Object
newAvg(int line, int column, boolean distinct, Object arg)
Object
newBetween(int line, int column, boolean not, Object arg, Object lower, Object upper)
Object
newBooleanLiteral(int line, int column, Object value)
Object
newCaseClause(int line, int column, Object base, List whenClauses, Object elseClause)
Object
newCoalesceClause(int line, int column, List clauses)
Object
newCollectionMemberVariableDecl(int line, int column, Object path, String variable)
Object
newConcat(int line, int column, List objects)
Object
newConstructor(int line, int column, String className, List args)
Object
newCount(int line, int column, boolean distinct, Object arg)
Object
newCurrentDate(int line, int column)
Object
newCurrentTime(int line, int column)
Object
newCurrentTimestamp(int line, int column)
Object
newDateLiteral(int line, int column, Object value)
Object
newDeleteClause(int line, int column, String schema, String variable)
Object
newDeleteStatement(int line, int column, Object delete, Object where)
Object
newDescOrdering(int line, int column, Object arg)
Object
newDivide(int line, int column, Object left, Object right)
Object
newDot(int line, int column, Object left, Object right)
Object
newDoubleLiteral(int line, int column, Object value)
Object
newEquals(int line, int column, Object left, Object right)
Object
newEscape(int line, int column, Object arg)
Object
newExists(int line, int column, boolean not, Object subquery)
Object
newFetchJoin(int line, int column, boolean outerJoin, Object path)
Object
newFloatLiteral(int line, int column, Object value)
Object
newFromClause(int line, int column, List decls)
Object
newFunc(int line, int column, String name, List parameters)
Object
newGreaterThan(int line, int column, Object left, Object right)
Object
newGreaterThanEqual(int line, int column, Object left, Object right)
Object
newGroupByClause(int line, int column, List items)
Object
newHavingClause(int line, int column, Object arg)
Object
newIn(int line, int column, boolean not, Object expr, Object subquery)
Object
newIn(int line, int column, boolean not, Object expr, List items)
Object
newIndex(int line, int column, Object object)
Object
newIntegerLiteral(int line, int column, Object value)
Object
newIsEmpty(int line, int column, boolean not, Object expr)
Object
newIsNull(int line, int column, boolean not, Object expr)
Object
newJoinVariableDecl(int line, int column, boolean outerJoin, Object path, String variable, Object downcast)
Object
newKey(int line, int column, Object left)
Object
newLength(int line, int column, Object arg)
Object
newLessThan(int line, int column, Object left, Object right)
Object
newLessThanEqual(int line, int column, Object left, Object right)
Object
newLike(int line, int column, boolean not, Object string, Object pattern, Object escape)
Object
newLocate(int line, int column, Object pattern, Object arg, Object startPos)
Object
newLongLiteral(int line, int column, Object value)
Object
newLower(int line, int column, Object arg)
Object
newMapEntry(int line, int column, Object arg)
Object
newMax(int line, int column, boolean distinct, Object arg)
Object
newMemberOf(int line, int column, boolean not, Object expr, Object collection)
Object
newMin(int line, int column, boolean distinct, Object arg)
Object
newMinus(int line, int column, Object left, Object right)
Object
newMod(int line, int column, Object left, Object right)
Object
newMultiply(int line, int column, Object left, Object right)
Object
newNamedParameter(int line, int column, String name)
Object
newNot(int line, int column, Object arg)
Object
newNotEquals(int line, int column, Object left, Object right)
Object
newNullIfClause(int line, int column, Object left, Object right)
Object
newNullLiteral(int line, int column)
Object
newOr(int line, int column, Object left, Object right)
Object
newOrderByClause(int line, int column, List items)
Object
newPlus(int line, int column, Object left, Object right)
Object
newPositionalParameter(int line, int column, String position)
Object
newQualifiedAttribute(int line, int column, String variable, String attribute)
Object
newRangeVariableDecl(int line, int column, String schema, String variable)
Object
newSelectClause(int line, int column, boolean distinct, List selectExprs)
Object
newSelectClause(int line, int column, boolean distinct, List selectExprs, List identifiers)
Object
newSelectStatement(int line, int column, Object select, Object from, Object where, Object groupBy, Object having, Object orderBy)
Object
newSetAssignmentClause(int line, int column, Object target, Object value)
Object
newSetClause(int line, int column, List assignments)
Object
newSize(int line, int column, Object arg)
Object
newSome(int line, int column, Object subquery)
Object
newSqrt(int line, int column, Object arg)
Object
newStringLiteral(int line, int column, Object value)
Object
newSubquery(int line, int column, Object select, Object from, Object where, Object groupBy, Object having)
Object
newSubstring(int line, int column, Object string, Object start, Object length)
Object
newSum(int line, int column, boolean distinct, Object arg)
Object
newTimeLiteral(int line, int column, Object value)
Object
newTimeStampLiteral(int line, int column, Object value)
Object
newTrim(int line, int column, NodeFactory.TrimSpecification trimSpec, Object trimChar, Object string)
Object
newType(int line, int column, Object left)
Object
newUnaryMinus(int line, int column, Object arg)
Object
newUnaryPlus(int line, int column, Object arg)
Object
newUpdateClause(int line, int column, String schema, String variable)
Object
newUpdateStatement(int line, int column, Object update, Object set, Object where)
Object
newUpper(int line, int column, Object arg)
Object
newVariableAccessOrTypeConstant(int line, int column, String identifier)
Object
newVariableDecl(int line, int column, Object path, String variable)
Object
newWhenClause(int line, int column, Object conditionClause, Object thenClause)
Object
newWhereClause(int line, int column, Object condition)
-
-
-
Constructor Detail
-
NodeFactoryImpl
public NodeFactoryImpl(String queryInfo)
No-arg Constructor
-
-
Method Detail
-
newSelectStatement
public Object newSelectStatement(int line, int column, Object select, Object from, Object where, Object groupBy, Object having, Object orderBy)
- Specified by:
newSelectStatement
in interfaceNodeFactory
-
newUpdateStatement
public Object newUpdateStatement(int line, int column, Object update, Object set, Object where)
- Specified by:
newUpdateStatement
in interfaceNodeFactory
-
newDeleteStatement
public Object newDeleteStatement(int line, int column, Object delete, Object where)
- Specified by:
newDeleteStatement
in interfaceNodeFactory
-
newSelectClause
public Object newSelectClause(int line, int column, boolean distinct, List selectExprs)
- Specified by:
newSelectClause
in interfaceNodeFactory
-
newSelectClause
public Object newSelectClause(int line, int column, boolean distinct, List selectExprs, List identifiers)
- Specified by:
newSelectClause
in interfaceNodeFactory
-
newFromClause
public Object newFromClause(int line, int column, List decls)
- Specified by:
newFromClause
in interfaceNodeFactory
-
newWhereClause
public Object newWhereClause(int line, int column, Object condition)
- Specified by:
newWhereClause
in interfaceNodeFactory
-
newGroupByClause
public Object newGroupByClause(int line, int column, List items)
- Specified by:
newGroupByClause
in interfaceNodeFactory
-
newHavingClause
public Object newHavingClause(int line, int column, Object arg)
- Specified by:
newHavingClause
in interfaceNodeFactory
-
newOrderByClause
public Object newOrderByClause(int line, int column, List items)
- Specified by:
newOrderByClause
in interfaceNodeFactory
-
newUpdateClause
public Object newUpdateClause(int line, int column, String schema, String variable)
- Specified by:
newUpdateClause
in interfaceNodeFactory
-
newDeleteClause
public Object newDeleteClause(int line, int column, String schema, String variable)
- Specified by:
newDeleteClause
in interfaceNodeFactory
-
newRangeVariableDecl
public Object newRangeVariableDecl(int line, int column, String schema, String variable)
- Specified by:
newRangeVariableDecl
in interfaceNodeFactory
-
newJoinVariableDecl
public Object newJoinVariableDecl(int line, int column, boolean outerJoin, Object path, String variable, Object downcast)
- Specified by:
newJoinVariableDecl
in interfaceNodeFactory
-
newFetchJoin
public Object newFetchJoin(int line, int column, boolean outerJoin, Object path)
- Specified by:
newFetchJoin
in interfaceNodeFactory
-
newCollectionMemberVariableDecl
public Object newCollectionMemberVariableDecl(int line, int column, Object path, String variable)
- Specified by:
newCollectionMemberVariableDecl
in interfaceNodeFactory
-
newVariableDecl
public Object newVariableDecl(int line, int column, Object path, String variable)
- Specified by:
newVariableDecl
in interfaceNodeFactory
-
newDot
public Object newDot(int line, int column, Object left, Object right)
- Specified by:
newDot
in interfaceNodeFactory
-
newVariableAccessOrTypeConstant
public Object newVariableAccessOrTypeConstant(int line, int column, String identifier)
- Specified by:
newVariableAccessOrTypeConstant
in interfaceNodeFactory
-
newAttribute
public Object newAttribute(int line, int column, String identifier)
- Specified by:
newAttribute
in interfaceNodeFactory
-
newQualifiedAttribute
public Object newQualifiedAttribute(int line, int column, String variable, String attribute)
- Specified by:
newQualifiedAttribute
in interfaceNodeFactory
-
newAvg
public Object newAvg(int line, int column, boolean distinct, Object arg)
- Specified by:
newAvg
in interfaceNodeFactory
-
newMax
public Object newMax(int line, int column, boolean distinct, Object arg)
- Specified by:
newMax
in interfaceNodeFactory
-
newMin
public Object newMin(int line, int column, boolean distinct, Object arg)
- Specified by:
newMin
in interfaceNodeFactory
-
newSum
public Object newSum(int line, int column, boolean distinct, Object arg)
- Specified by:
newSum
in interfaceNodeFactory
-
newCount
public Object newCount(int line, int column, boolean distinct, Object arg)
- Specified by:
newCount
in interfaceNodeFactory
-
newOr
public Object newOr(int line, int column, Object left, Object right)
- Specified by:
newOr
in interfaceNodeFactory
-
newAnd
public Object newAnd(int line, int column, Object left, Object right)
- Specified by:
newAnd
in interfaceNodeFactory
-
newEquals
public Object newEquals(int line, int column, Object left, Object right)
- Specified by:
newEquals
in interfaceNodeFactory
-
newNotEquals
public Object newNotEquals(int line, int column, Object left, Object right)
- Specified by:
newNotEquals
in interfaceNodeFactory
-
newGreaterThan
public Object newGreaterThan(int line, int column, Object left, Object right)
- Specified by:
newGreaterThan
in interfaceNodeFactory
-
newGreaterThanEqual
public Object newGreaterThanEqual(int line, int column, Object left, Object right)
- Specified by:
newGreaterThanEqual
in interfaceNodeFactory
-
newLessThan
public Object newLessThan(int line, int column, Object left, Object right)
- Specified by:
newLessThan
in interfaceNodeFactory
-
newLessThanEqual
public Object newLessThanEqual(int line, int column, Object left, Object right)
- Specified by:
newLessThanEqual
in interfaceNodeFactory
-
newPlus
public Object newPlus(int line, int column, Object left, Object right)
- Specified by:
newPlus
in interfaceNodeFactory
-
newMinus
public Object newMinus(int line, int column, Object left, Object right)
- Specified by:
newMinus
in interfaceNodeFactory
-
newMultiply
public Object newMultiply(int line, int column, Object left, Object right)
- Specified by:
newMultiply
in interfaceNodeFactory
-
newBetween
public Object newBetween(int line, int column, boolean not, Object arg, Object lower, Object upper)
- Specified by:
newBetween
in interfaceNodeFactory
-
newDivide
public Object newDivide(int line, int column, Object left, Object right)
- Specified by:
newDivide
in interfaceNodeFactory
-
newUnaryPlus
public Object newUnaryPlus(int line, int column, Object arg)
- Specified by:
newUnaryPlus
in interfaceNodeFactory
-
newUnaryMinus
public Object newUnaryMinus(int line, int column, Object arg)
- Specified by:
newUnaryMinus
in interfaceNodeFactory
-
newNot
public Object newNot(int line, int column, Object arg)
- Specified by:
newNot
in interfaceNodeFactory
-
newLike
public Object newLike(int line, int column, boolean not, Object string, Object pattern, Object escape)
- Specified by:
newLike
in interfaceNodeFactory
-
newEscape
public Object newEscape(int line, int column, Object arg)
- Specified by:
newEscape
in interfaceNodeFactory
-
newIn
public Object newIn(int line, int column, boolean not, Object expr, List items)
- Specified by:
newIn
in interfaceNodeFactory
-
newIsNull
public Object newIsNull(int line, int column, boolean not, Object expr)
- Specified by:
newIsNull
in interfaceNodeFactory
-
newIsEmpty
public Object newIsEmpty(int line, int column, boolean not, Object expr)
- Specified by:
newIsEmpty
in interfaceNodeFactory
-
newMemberOf
public Object newMemberOf(int line, int column, boolean not, Object expr, Object collection)
- Specified by:
newMemberOf
in interfaceNodeFactory
-
newPositionalParameter
public Object newPositionalParameter(int line, int column, String position)
- Specified by:
newPositionalParameter
in interfaceNodeFactory
-
newNamedParameter
public Object newNamedParameter(int line, int column, String name)
- Specified by:
newNamedParameter
in interfaceNodeFactory
-
newBooleanLiteral
public Object newBooleanLiteral(int line, int column, Object value)
- Specified by:
newBooleanLiteral
in interfaceNodeFactory
-
newIntegerLiteral
public Object newIntegerLiteral(int line, int column, Object value)
- Specified by:
newIntegerLiteral
in interfaceNodeFactory
-
newLongLiteral
public Object newLongLiteral(int line, int column, Object value)
- Specified by:
newLongLiteral
in interfaceNodeFactory
-
newFloatLiteral
public Object newFloatLiteral(int line, int column, Object value)
- Specified by:
newFloatLiteral
in interfaceNodeFactory
-
newDoubleLiteral
public Object newDoubleLiteral(int line, int column, Object value)
- Specified by:
newDoubleLiteral
in interfaceNodeFactory
-
newStringLiteral
public Object newStringLiteral(int line, int column, Object value)
- Specified by:
newStringLiteral
in interfaceNodeFactory
-
newNullLiteral
public Object newNullLiteral(int line, int column)
- Specified by:
newNullLiteral
in interfaceNodeFactory
-
newConcat
public Object newConcat(int line, int column, List objects)
- Specified by:
newConcat
in interfaceNodeFactory
-
newSubstring
public Object newSubstring(int line, int column, Object string, Object start, Object length)
- Specified by:
newSubstring
in interfaceNodeFactory
-
newTrim
public Object newTrim(int line, int column, NodeFactory.TrimSpecification trimSpec, Object trimChar, Object string)
- Specified by:
newTrim
in interfaceNodeFactory
-
newLower
public Object newLower(int line, int column, Object arg)
- Specified by:
newLower
in interfaceNodeFactory
-
newUpper
public Object newUpper(int line, int column, Object arg)
- Specified by:
newUpper
in interfaceNodeFactory
-
newLocate
public Object newLocate(int line, int column, Object pattern, Object arg, Object startPos)
- Specified by:
newLocate
in interfaceNodeFactory
-
newLength
public Object newLength(int line, int column, Object arg)
- Specified by:
newLength
in interfaceNodeFactory
-
newAbs
public Object newAbs(int line, int column, Object arg)
- Specified by:
newAbs
in interfaceNodeFactory
-
newSqrt
public Object newSqrt(int line, int column, Object arg)
- Specified by:
newSqrt
in interfaceNodeFactory
-
newMod
public Object newMod(int line, int column, Object left, Object right)
- Specified by:
newMod
in interfaceNodeFactory
-
newSize
public Object newSize(int line, int column, Object arg)
- Specified by:
newSize
in interfaceNodeFactory
-
newCurrentDate
public Object newCurrentDate(int line, int column)
- Specified by:
newCurrentDate
in interfaceNodeFactory
-
newCurrentTime
public Object newCurrentTime(int line, int column)
- Specified by:
newCurrentTime
in interfaceNodeFactory
-
newCurrentTimestamp
public Object newCurrentTimestamp(int line, int column)
- Specified by:
newCurrentTimestamp
in interfaceNodeFactory
-
newFunc
public Object newFunc(int line, int column, String name, List parameters)
- Specified by:
newFunc
in interfaceNodeFactory
-
newSubquery
public Object newSubquery(int line, int column, Object select, Object from, Object where, Object groupBy, Object having)
- Specified by:
newSubquery
in interfaceNodeFactory
-
newExists
public Object newExists(int line, int column, boolean not, Object subquery)
- Specified by:
newExists
in interfaceNodeFactory
-
newIn
public Object newIn(int line, int column, boolean not, Object expr, Object subquery)
- Specified by:
newIn
in interfaceNodeFactory
-
newAll
public Object newAll(int line, int column, Object subquery)
- Specified by:
newAll
in interfaceNodeFactory
-
newAny
public Object newAny(int line, int column, Object subquery)
- Specified by:
newAny
in interfaceNodeFactory
-
newSome
public Object newSome(int line, int column, Object subquery)
- Specified by:
newSome
in interfaceNodeFactory
-
newAscOrdering
public Object newAscOrdering(int line, int column, Object arg)
- Specified by:
newAscOrdering
in interfaceNodeFactory
-
newDescOrdering
public Object newDescOrdering(int line, int column, Object arg)
- Specified by:
newDescOrdering
in interfaceNodeFactory
-
newConstructor
public Object newConstructor(int line, int column, String className, List args)
- Specified by:
newConstructor
in interfaceNodeFactory
-
newSetClause
public Object newSetClause(int line, int column, List assignments)
- Specified by:
newSetClause
in interfaceNodeFactory
-
newSetAssignmentClause
public Object newSetAssignmentClause(int line, int column, Object target, Object value)
- Specified by:
newSetAssignmentClause
in interfaceNodeFactory
-
newKey
public Object newKey(int line, int column, Object left)
- Specified by:
newKey
in interfaceNodeFactory
-
newMapEntry
public Object newMapEntry(int line, int column, Object arg)
- Specified by:
newMapEntry
in interfaceNodeFactory
-
newType
public Object newType(int line, int column, Object left)
- Specified by:
newType
in interfaceNodeFactory
-
newCaseClause
public Object newCaseClause(int line, int column, Object base, List whenClauses, Object elseClause)
- Specified by:
newCaseClause
in interfaceNodeFactory
-
newCoalesceClause
public Object newCoalesceClause(int line, int column, List clauses)
- Specified by:
newCoalesceClause
in interfaceNodeFactory
-
newNullIfClause
public Object newNullIfClause(int line, int column, Object left, Object right)
- Specified by:
newNullIfClause
in interfaceNodeFactory
-
newWhenClause
public Object newWhenClause(int line, int column, Object conditionClause, Object thenClause)
- Specified by:
newWhenClause
in interfaceNodeFactory
-
newIndex
public Object newIndex(int line, int column, Object object)
- Specified by:
newIndex
in interfaceNodeFactory
-
newDateLiteral
public Object newDateLiteral(int line, int column, Object value)
- Specified by:
newDateLiteral
in interfaceNodeFactory
-
newTimeLiteral
public Object newTimeLiteral(int line, int column, Object value)
- Specified by:
newTimeLiteral
in interfaceNodeFactory
-
newTimeStampLiteral
public Object newTimeStampLiteral(int line, int column, Object value)
- Specified by:
newTimeStampLiteral
in interfaceNodeFactory
-
-