java.lang.Object
org.eclipse.persistence.jpa.jpql.parser.AbstractExpression
org.eclipse.persistence.jpa.jpql.parser.AbstractEncapsulatedExpression
org.eclipse.persistence.jpa.jpql.parser.AbstractSingleEncapsulatedExpression
org.eclipse.persistence.jpa.jpql.parser.SubExpression
- All Implemented Interfaces:
Expression,ParentExpression
public final class SubExpression
extends AbstractSingleEncapsulatedExpression
implements ParentExpression
This expression wraps a sub-expression within parenthesis.
BNF:
expression ::= (sub_expression)- Version:
- 2.5
- Author:
- Pascal Filion
-
Field Summary
Fields inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractExpression
COMMA, DOT, DOUBLE_QUOTE, LEFT_CURLY_BRACKET, LEFT_PARENTHESIS, NOT_DEFINED, RIGHT_CURLY_BRACKET, RIGHT_PARENTHESIS, SINGLE_QUOTE, SPACE, UNDERSCOREFields inherited from interface org.eclipse.persistence.jpa.jpql.parser.Expression
ABS, ALL, AND, ANY, AS, AS_OF, ASC, AVG, BETWEEN, BIT_LENGTH, BOTH, CASE, CAST, CEILING, CHAR_LENGTH, CHARACTER_LENGTH, CLASS, COALESCE, COLUMN, CONCAT, CONCAT_PIPES, CONNECT_BY, COUNT, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, DATE, DATETIME, DELETE, DELETE_FROM, DESC, DIFFERENT, DISTINCT, DIVISION, ELSE, EMPTY, END, ENTRY, EQUAL, ESCAPE, EXCEPT, EXISTS, EXP, EXTRACT, FALSE, FETCH, FIRST, FLOOR, FROM, FUNC, FUNCTION, GREATER_THAN, GREATER_THAN_OR_EQUAL, GROUP_BY, HAVING, ID, IN, INDEX, INNER, INNER_JOIN, INNER_JOIN_FETCH, INTERSECT, IS, IS_EMPTY, IS_NOT_EMPTY, IS_NOT_NULL, IS_NULL, JOIN, JOIN_FETCH, KEY, LAST, LEADING, LEFT, LEFT_JOIN, LEFT_JOIN_FETCH, LEFT_OUTER_JOIN, LEFT_OUTER_JOIN_FETCH, LENGTH, LIKE, LN, LOCAL, LOCATE, LOWER, LOWER_THAN, LOWER_THAN_OR_EQUAL, MAX, MEMBER, MEMBER_OF, MIN, MINUS, MOD, MULTIPLICATION, NAMED_PARAMETER, NEW, NOT, NOT_BETWEEN, NOT_EQUAL, NOT_EXISTS, NOT_IN, NOT_LIKE, NOT_MEMBER, NOT_MEMBER_OF, NULL, NULLIF, NULLS, NULLS_FIRST, NULLS_LAST, OBJECT, OF, ON, OPERATOR, OR, ORDER_BY, ORDER_SIBLINGS_BY, OUTER, PLUS, POSITION, POSITIONAL_PARAMETER, POWER, QUOTE, REGEXP, REPLACE, RIGHT, ROUND, SCN, SELECT, SET, SIGN, SIZE, SOME, SQL, SQRT, START_WITH, SUBSTRING, SUM, TABLE, THEN, THIS, TIME, TIMESTAMP, TRAILING, TREAT, TRIM, TRUE, TYPE, UNION, UNKNOWN, UPDATE, UPPER, VALUE, VERSION, WHEN, WHERE -
Constructor Summary
ConstructorsConstructorDescriptionSubExpression(AbstractExpression parent, JPQLQueryBNF queryBNF) Creates a newSubExpression. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ExpressionVisitor visitor) Visits thisExpressionby the givenvisitor.protected booleanfindQueryBNF(Expression expression) Retrieves theJPQLQueryBNFthat represents the fragment of thisExpressionthat was used when parsing the givenExpression.Returns the BNF used to parse the encapsulated expression.Get list ofIdentificationVariablewhere this alias should be added.Returns the BNF of thisExpression.protected booleanhandleCollection(JPQLQueryBNF queryBNF) Determines whether the givenJPQLQueryBNFhandles a collection of sub-expressions that are separated by commas.booleanWhether Hermes parser should automatically add missing "this" prefix into where field variables if it doesn't exist.booleanFlag if expression is a parent/root in the tree.booleanvoidsetGenerateImplicitThisAlias(boolean generateImplicitThisAlias) Methods inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractSingleEncapsulatedExpression
acceptChildren, addChildrenTo, addOrderedEncapsulatedExpressionTo, getExpression, hasEncapsulatedExpression, hasExpression, parseEncapsulatedExpression, removeEncapsulatedExpression, setExpression, toParsedTextEncapsulatedExpressionMethods inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractEncapsulatedExpression
addOrderedChildrenTo, getActualIdentifier, getIdentifier, hasLeftParenthesis, hasRightParenthesis, hasSpaceAfterIdentifier, isInvalid, isParsingComplete, parse, shouldParseRightParenthesis, toParsedTextMethods inherited from class org.eclipse.persistence.jpa.jpql.parser.AbstractExpression
acceptUnknownVisitor, acceptUnknownVisitor, buildExpressionFromFallingBack, buildNullExpression, buildStringExpression, buildStringExpression, buildUnknownExpression, calculatePosition, children, findFallBackExpressionFactory, getExpressionFactory, getExpressionRegistry, getGrammar, getIdentifierVersion, getJPAVersion, getLength, getOffset, getParent, getParentExpression, getQueryBNF, getRoot, getText, handleAggregate, isAncestor, isIdentifier, isNull, isTolerant, isUnknown, isVirtual, orderedChildren, parse, parseUsingExpressionFactory, populatePosition, rebuildActualText, rebuildParsedText, setParent, setText, shouldParseWithFactoryFirst, shouldSkipLiteral, toActualText, toParsedText, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.persistence.jpa.jpql.parser.Expression
acceptChildren, children, getGrammar, getLength, getOffset, getParent, getRoot, isAncestor, orderedChildren, populatePosition, toActualText, toParsedText
-
Constructor Details
-
SubExpression
Creates a newSubExpression.- Parameters:
parent- The parent of this expressionqueryBNF- The BNF coming from the parent that is used to parse the next portion of the query
-
-
Method Details
-
isGenerateImplicitThisAlias
public boolean isGenerateImplicitThisAlias()Description copied from interface:ParentExpressionWhether Hermes parser should automatically add missing "this" prefix into where field variables if it doesn't exist.- Specified by:
isGenerateImplicitThisAliasin interfaceParentExpression- Returns:
booleantrue- if this aliases should be generated ,false- if not
-
setGenerateImplicitThisAlias
public void setGenerateImplicitThisAlias(boolean generateImplicitThisAlias) - Specified by:
setGenerateImplicitThisAliasin interfaceParentExpression
-
isParentExpression
public boolean isParentExpression()Description copied from class:AbstractExpressionFlag if expression is a parent/root in the tree.- Overrides:
isParentExpressionin classAbstractExpression- Returns:
booleantrue- yes it's parent/root ,false- if not
-
isSubExpression
public boolean isSubExpression()- Overrides:
isSubExpressionin classAbstractExpression
-
accept
Description copied from interface:ExpressionVisits thisExpressionby the givenvisitor.- Specified by:
acceptin interfaceExpression- Parameters:
visitor- TheExpressionVisitorto visit this object
-
areLogicalIdentifiersSupported
protected boolean areLogicalIdentifiersSupported()- Overrides:
areLogicalIdentifiersSupportedin classAbstractEncapsulatedExpression
-
getEncapsulatedExpressionQueryBNFId
Description copied from class:AbstractSingleEncapsulatedExpressionReturns the BNF used to parse the encapsulated expression.- Specified by:
getEncapsulatedExpressionQueryBNFIdin classAbstractSingleEncapsulatedExpression- Returns:
- The BNF used to parse the encapsulated expression
-
findQueryBNF
Description copied from interface:ExpressionRetrieves theJPQLQueryBNFthat represents the fragment of thisExpressionthat was used when parsing the givenExpression.- Specified by:
findQueryBNFin interfaceExpression- Overrides:
findQueryBNFin classAbstractSingleEncapsulatedExpression- Parameters:
expression- TheExpressionthat is a descendant of this one- Returns:
- The
JPQLQueryBNFthat was used to parse the given expression
-
getQueryBNF
Description copied from interface:ExpressionReturns the BNF of thisExpression.- Specified by:
getQueryBNFin interfaceExpression- Returns:
- The
JPQLQueryBNF, which represents the grammar of thisExpression
-
handleCollection
Description copied from class:AbstractExpressionDetermines whether the givenJPQLQueryBNFhandles a collection of sub-expressions that are separated by commas.- Overrides:
handleCollectionin classAbstractExpression- Parameters:
queryBNF- TheJPQLQueryBNFused to determine if the parsing should handle collection of sub-expressions- Returns:
trueif the sub-expression to parse might have several sub-expressions separated by commas;falseotherwise
-
getIdentificationVariablesWithoutAlias
Description copied from interface:ParentExpressionGet list ofIdentificationVariablewhere this alias should be added.- Specified by:
getIdentificationVariablesWithoutAliasin interfaceParentExpression
-