Interface Expression
-
- All Known Implementing Classes:
AbsExpression
,AbstractConditionalClause
,AbstractDoubleEncapsulatedExpression
,AbstractEncapsulatedExpression
,AbstractExpression
,AbstractFromClause
,AbstractOrderByClause
,AbstractPathExpression
,AbstractSchemaName
,AbstractSelectClause
,AbstractSelectStatement
,AbstractSingleEncapsulatedExpression
,AbstractTripleEncapsulatedExpression
,AdditionExpression
,AggregateFunction
,AllOrAnyExpression
,AndExpression
,ArithmeticExpression
,ArithmeticFactor
,AsOfClause
,AvgFunction
,BadExpression
,BetweenExpression
,CaseExpression
,CastExpression
,CoalesceExpression
,CollectionExpression
,CollectionMemberDeclaration
,CollectionMemberExpression
,CollectionValuedPathExpression
,ComparisonExpression
,CompoundExpression
,ConcatExpression
,ConnectByClause
,ConstructorExpression
,CountFunction
,DatabaseType
,DateTime
,DefaultStringExpression
,DeleteClause
,DeleteStatement
,DivisionExpression
,EmptyCollectionComparisonExpression
,EncapsulatedIdentificationVariableExpression
,EntityTypeLiteral
,EntryExpression
,ExistsExpression
,ExtractExpression
,FromClause
,FunctionExpression
,GroupByClause
,HavingClause
,HierarchicalQueryClause
,IdentificationVariable
,IdentificationVariableDeclaration
,IndexExpression
,InExpression
,InputParameter
,Join
,JPQLExpression
,KeyExpression
,KeywordExpression
,LengthExpression
,LikeExpression
,LocateExpression
,LogicalExpression
,LowerExpression
,MaxFunction
,MinFunction
,ModExpression
,MultiplicationExpression
,NotExpression
,NullComparisonExpression
,NullExpression
,NullIfExpression
,NumericLiteral
,ObjectExpression
,OnClause
,OrderByClause
,OrderByItem
,OrderSiblingsByClause
,OrExpression
,RangeVariableDeclaration
,RegexpExpression
,ResultVariable
,SelectClause
,SelectStatement
,SimpleFromClause
,SimpleSelectClause
,SimpleSelectStatement
,SizeExpression
,SqrtExpression
,StartWithClause
,StateFieldPathExpression
,StringLiteral
,SubExpression
,SubstringExpression
,SubtractionExpression
,SumFunction
,TableExpression
,TableVariableDeclaration
,TreatExpression
,TrimExpression
,TypeExpression
,UnionClause
,UnknownExpression
,UpdateClause
,UpdateItem
,UpdateStatement
,UpperExpression
,ValueExpression
,WhenClause
,WhereClause
public interface Expression
This is the root interface of the parsed tree representation of a JPQL query. The way a JPQL query is parsed is based on theJPQL grammar
used.Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
- Version:
- 2.5
- See Also:
JPQLGrammar
- Author:
- Pascal Filion
- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description static String
ABS
The constant for 'ABS'.static String
ALL
The constant for 'ALL'.static String
AND
The constant for 'AND'.static String
ANY
The constant for 'ANY'.static String
AS
The constant for 'AS'.static String
AS_OF
The constant for 'AS OF'.static String
ASC
The constant for 'ASC'.static String
AVG
The constant for 'AVG'.static String
BETWEEN
The constant for 'BETWEEN'.static String
BIT_LENGTH
The constant for 'BIT_LENGTH', which is an unused keyword.static String
BOTH
The constant for 'BOTH'.static String
CASE
The constant for the identifier 'CASE'.static String
CAST
The constant for the identifier 'CAST'.static String
CHAR_LENGTH
The constant for 'CHAR_LENGTH', which is an unused keyword.static String
CHARACTER_LENGTH
The constant for 'CHARACTER_LENGTH', which is an unused keyword.static String
CLASS
The constant for 'CLASS', which is an unused keyword.static String
COALESCE
The constant for 'COALESCE'.static String
COLUMN
The constant 'COLUMN', which is an EclipseLink specific identifier that was added in version 2.4.static String
CONCAT
The constant for 'CONCAT'.static String
CONNECT_BY
The constant for 'CONNECT BY'.static String
COUNT
The constant for 'COUNT'.static String
CURRENT_DATE
The constant for 'CURRENT_DATE'.static String
CURRENT_TIME
The constant for 'CURRENT_DATE'.static String
CURRENT_TIMESTAMP
The constant for 'CURRENT_TIMESTAMP'.static String
DELETE
The constant for 'DELETE'.static String
DELETE_FROM
The constant for 'DELETE FROM'.static String
DESC
The constant for 'DESC'.static String
DIFFERENT
The constant for '<>'.static String
DISTINCT
The constant for 'DISTINCT'.static String
DIVISION
The constant for the division sign '/'.static String
ELSE
The constant for the identifier 'ELSE'.static String
EMPTY
The constant for 'EMPTY'.static String
END
The constant for the identifier 'END'.static String
ENTRY
The constant for 'ENTRY'.static String
EQUAL
The constant for '='.static String
ESCAPE
The constant for 'ESCAPE'.static String
EXCEPT
The constant for 'EXCEPT'.static String
EXISTS
The constant for 'EXISTS'.static String
EXTRACT
The constant for 'EXTRACT'.static String
FALSE
The constant for 'FALSE'.static String
FETCH
A constant for 'FETCH'.static String
FIRST
The constant for 'FIRST'.static String
FROM
The constant for 'FROM'.static String
FUNC
The constant 'FUNC', which is an EclipseLink specific identifier that was added in version 2.1.static String
FUNCTION
The constant 'FUNCTION', part of JPA 2.1.static String
GREATER_THAN
The constant for '>'.static String
GREATER_THAN_OR_EQUAL
The constant for '>='.static String
GROUP_BY
The constant for 'GROUP BY'.static String
HAVING
The constant for 'HAVING'.static String
IN
The constant for 'IN'.static String
INDEX
The constant for 'INDEX'.static String
INNER
The constant for 'INNER'.static String
INNER_JOIN
The constant for 'INNER JOIN'.static String
INNER_JOIN_FETCH
The constant for 'INNER JOIN FETCH'.static String
INTERSECT
The constant for 'INTERSECT'.static String
IS
The constant for 'IS'.static String
IS_EMPTY
The constant for 'IS EMPTY'.static String
IS_NOT_EMPTY
The constant for 'IS NOT EMPTY'.static String
IS_NOT_NULL
The constant for 'IS NOT NULL'.static String
IS_NULL
The constant for 'IS NULL'.static String
JOIN
The constant for 'JOIN'.static String
JOIN_FETCH
The constant for 'JOIN FETCH'.static String
KEY
The constant for 'KEY'.static String
LAST
The constant for 'LAST'.static String
LEADING
The constant for 'LEADING'.static String
LEFT
The constant for 'LEFT'.static String
LEFT_JOIN
The constant for 'LEFT JOIN'.static String
LEFT_JOIN_FETCH
The constant for 'LEFT JOIN FETCH'.static String
LEFT_OUTER_JOIN
The constant for 'LEFT OUTER JOIN'.static String
LEFT_OUTER_JOIN_FETCH
The constant for 'LEFT OUTER JOIN FETCH'.static String
LENGTH
The constant for 'LENGTH'.static String
LIKE
The constant for 'LIKE'.static String
LOCATE
The constant for 'LOCATE'.static String
LOWER
The constant for 'LOWER'.static String
LOWER_THAN
The constant for '<'.static String
LOWER_THAN_OR_EQUAL
The constant for '<='.static String
MAX
The constant for 'MAX'.static String
MEMBER
The constant for 'MEMBER'.static String
MEMBER_OF
The constant for 'MEMBER OF'.static String
MIN
The constant for 'MIN'.static String
MINUS
The constant for the minus sign '-'.static String
MOD
The constant for 'MOD'.static String
MULTIPLICATION
The constant for multiplication sign '*'.static String
NAMED_PARAMETER
The constant for ':'.static String
NEW
The constant for 'NEW'.static String
NOT
The constant for 'NOT'.static String
NOT_BETWEEN
The constant for 'NOT BETWEEN'.static String
NOT_EQUAL
The constant for '!='.static String
NOT_EXISTS
The constant for 'NOT EXISTS'.static String
NOT_IN
The constant for 'NOT IN'.static String
NOT_LIKE
The constant for 'NOT LIKE'.static String
NOT_MEMBER
The constant for 'NOT MEMBER'.static String
NOT_MEMBER_OF
The constant for 'NOT MEMBER OF'.static String
NULL
The constant for 'NULL'.static String
NULLIF
The constant for 'NULLIF'.static String
NULLS
The constant for 'NULLS'.static String
NULLS_FIRST
The constant for 'NULLS FIRST'.static String
NULLS_LAST
The constant for 'NULLS LAST'.static String
OBJECT
The constant for 'OBJECT'.static String
OF
The constant for 'OF'.static String
ON
The constant for 'ON', which is an EclipseLink specific identifier that was added in version 2.4.static String
OPERATOR
The constant 'OPERATOR', which is an EclipseLink specific identifier that was added in version 2.4.static String
OR
The constant for 'OR'.static String
ORDER_BY
The constant for 'ORDER BY'.static String
ORDER_SIBLINGS_BY
The constant for 'ORDER SIBLINGS BY'.static String
OUTER
The constant for 'OUTER'.static String
PLUS
The constant for for the plus sign '+'.static String
POSITION
The constant for 'POSITION', which is an unused keyword.static String
POSITIONAL_PARAMETER
The constant for '?'.static String
QUOTE
The constant for single quote.static String
REGEXP
The constant for 'REGEXP'.static String
SCN
The constant for 'SCN'.static String
SELECT
The constant for 'SELECT'.static String
SET
The constant for 'SET'.static String
SIZE
The constant for 'SIZE'.static String
SOME
The constant for 'SOME'.static String
SQL
The constant 'SQL', which is an EclipseLink specific identifier that was added in version 2.4.static String
SQRT
The constant for 'SQRT'.static String
START_WITH
The constant for 'WHERE'.static String
SUBSTRING
The constant for 'SUBSTRING'.static String
SUM
The constant for 'SUM'.static String
TABLE
The constant for 'TABLE'.static String
THEN
The constant for 'THEN'.static String
TIMESTAMP
The constant for 'TIMESTAMP'.static String
TRAILING
The constant for 'TRAILING'.static String
TREAT
The constant for 'TREAT', which is an EclipseLink specific identifier that was added in version 2.1.static String
TRIM
The constant for 'TRIM'.static String
TRUE
The constant for 'TRUE'.static String
TYPE
The constant for 'TYPE'.static String
UNION
The constant for 'UNION'.static String
UNKNOWN
The constant for 'UNKNOWN', which is an unused keyword.static String
UPDATE
The constant for 'UPDATE'.static String
UPPER
The constant for 'UPPER'.static String
VALUE
The constant for 'VALUE'.static String
WHEN
The constant for the identifier 'WHEN'.static String
WHERE
The constant for 'WHERE'.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
accept(ExpressionVisitor visitor)
Visits thisExpression
by the givenvisitor
.void
acceptChildren(ExpressionVisitor visitor)
Visits the children of thisExpression
.ListIterable<Expression>
children()
Returns the children of thisExpression
.JPQLQueryBNF
findQueryBNF(Expression expression)
Retrieves theJPQLQueryBNF
that represents the fragment of thisExpression
that was used when parsing the givenExpression
.JPQLGrammar
getGrammar()
Returns theJPQLGrammar
that defines how the JPQL query was parsed.int
getLength()
Returns the length of the string representation of thisExpression
, which is the length of the text generated bytoActualText()
.int
getOffset()
Returns the position of thisExpression
within its parent hierarchy.Expression
getParent()
Returns the parent of thisExpression
.JPQLQueryBNF
getQueryBNF()
Returns the BNF of thisExpression
.JPQLExpression
getRoot()
Retrieves the root node of the parsed tree hierarchy.boolean
isAncestor(Expression expression)
Determines whether thisExpression
is a parent of the givenExpression
.ListIterable<Expression>
orderedChildren()
Returns the list representing thisExpression
and its children.void
populatePosition(QueryPosition queryPosition, int position)
Retrieves theExpression
located at the given position using the actual query, which may have extra whitespace.String
toActualText()
Generates a string representation of thisExpression
, which needs to include any characters that are considered virtual, i.e.String
toParsedText()
Returns a string representation of thisExpression
and its children.
-
-
-
Field Detail
-
ABS
static final String ABS
The constant for 'ABS'.- See Also:
- Constant Field Values
-
ALL
static final String ALL
The constant for 'ALL'.- See Also:
- Constant Field Values
-
AND
static final String AND
The constant for 'AND'.- See Also:
- Constant Field Values
-
ANY
static final String ANY
The constant for 'ANY'.- See Also:
- Constant Field Values
-
AS
static final String AS
The constant for 'AS'.- See Also:
- Constant Field Values
-
AS_OF
static final String AS_OF
The constant for 'AS OF'.- See Also:
- Constant Field Values
- Since:
- 2.5
-
ASC
static final String ASC
The constant for 'ASC'.- See Also:
- Constant Field Values
-
AVG
static final String AVG
The constant for 'AVG'.- See Also:
- Constant Field Values
-
BETWEEN
static final String BETWEEN
The constant for 'BETWEEN'.- See Also:
- Constant Field Values
-
BIT_LENGTH
static final String BIT_LENGTH
The constant for 'BIT_LENGTH', which is an unused keyword.- See Also:
- Constant Field Values
-
BOTH
static final String BOTH
The constant for 'BOTH'.- See Also:
- Constant Field Values
-
CASE
static final String CASE
The constant for the identifier 'CASE'.- See Also:
- Constant Field Values
-
CAST
static final String CAST
The constant for the identifier 'CAST'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
CHAR_LENGTH
static final String CHAR_LENGTH
The constant for 'CHAR_LENGTH', which is an unused keyword.- See Also:
- Constant Field Values
-
CHARACTER_LENGTH
static final String CHARACTER_LENGTH
The constant for 'CHARACTER_LENGTH', which is an unused keyword.- See Also:
- Constant Field Values
-
CLASS
static final String CLASS
The constant for 'CLASS', which is an unused keyword.- See Also:
- Constant Field Values
-
COALESCE
static final String COALESCE
The constant for 'COALESCE'.- See Also:
- Constant Field Values
-
COLUMN
static final String COLUMN
The constant 'COLUMN', which is an EclipseLink specific identifier that was added in version 2.4.- See Also:
- Constant Field Values
- Since:
- 2.4
-
CONCAT
static final String CONCAT
The constant for 'CONCAT'.- See Also:
- Constant Field Values
-
CONNECT_BY
static final String CONNECT_BY
The constant for 'CONNECT BY'.- See Also:
- Constant Field Values
- Since:
- 2.5
-
COUNT
static final String COUNT
The constant for 'COUNT'.- See Also:
- Constant Field Values
-
CURRENT_DATE
static final String CURRENT_DATE
The constant for 'CURRENT_DATE'.- See Also:
- Constant Field Values
-
CURRENT_TIME
static final String CURRENT_TIME
The constant for 'CURRENT_DATE'.- See Also:
- Constant Field Values
-
CURRENT_TIMESTAMP
static final String CURRENT_TIMESTAMP
The constant for 'CURRENT_TIMESTAMP'.- See Also:
- Constant Field Values
-
DELETE
static final String DELETE
The constant for 'DELETE'.- See Also:
- Constant Field Values
-
DELETE_FROM
static final String DELETE_FROM
The constant for 'DELETE FROM'.- See Also:
- Constant Field Values
-
DESC
static final String DESC
The constant for 'DESC'.- See Also:
- Constant Field Values
-
DIFFERENT
static final String DIFFERENT
The constant for '<>'.- See Also:
- Constant Field Values
-
DISTINCT
static final String DISTINCT
The constant for 'DISTINCT'.- See Also:
- Constant Field Values
-
DIVISION
static final String DIVISION
The constant for the division sign '/'.- See Also:
- Constant Field Values
-
ELSE
static final String ELSE
The constant for the identifier 'ELSE'.- See Also:
- Constant Field Values
-
EMPTY
static final String EMPTY
The constant for 'EMPTY'.- See Also:
- Constant Field Values
-
END
static final String END
The constant for the identifier 'END'.- See Also:
- Constant Field Values
-
ENTRY
static final String ENTRY
The constant for 'ENTRY'.- See Also:
- Constant Field Values
-
EQUAL
static final String EQUAL
The constant for '='.- See Also:
- Constant Field Values
-
ESCAPE
static final String ESCAPE
The constant for 'ESCAPE'.- See Also:
- Constant Field Values
-
EXCEPT
static final String EXCEPT
The constant for 'EXCEPT'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
EXISTS
static final String EXISTS
The constant for 'EXISTS'.- See Also:
- Constant Field Values
-
EXTRACT
static final String EXTRACT
The constant for 'EXTRACT'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
FALSE
static final String FALSE
The constant for 'FALSE'.- See Also:
- Constant Field Values
-
FETCH
static final String FETCH
A constant for 'FETCH'.- See Also:
- Constant Field Values
-
FIRST
static final String FIRST
The constant for 'FIRST'.- See Also:
- Constant Field Values
- Since:
- 2.5
-
FROM
static final String FROM
The constant for 'FROM'.- See Also:
- Constant Field Values
-
FUNC
static final String FUNC
The constant 'FUNC', which is an EclipseLink specific identifier that was added in version 2.1.- See Also:
- Constant Field Values
-
FUNCTION
static final String FUNCTION
The constant 'FUNCTION', part of JPA 2.1.- See Also:
- Constant Field Values
- Since:
- 2.4
-
GREATER_THAN
static final String GREATER_THAN
The constant for '>'.- See Also:
- Constant Field Values
-
GREATER_THAN_OR_EQUAL
static final String GREATER_THAN_OR_EQUAL
The constant for '>='.- See Also:
- Constant Field Values
-
GROUP_BY
static final String GROUP_BY
The constant for 'GROUP BY'.- See Also:
- Constant Field Values
-
HAVING
static final String HAVING
The constant for 'HAVING'.- See Also:
- Constant Field Values
-
IN
static final String IN
The constant for 'IN'.- See Also:
- Constant Field Values
-
INDEX
static final String INDEX
The constant for 'INDEX'.- See Also:
- Constant Field Values
-
INNER
static final String INNER
The constant for 'INNER'.- See Also:
- Constant Field Values
-
INNER_JOIN
static final String INNER_JOIN
The constant for 'INNER JOIN'.- See Also:
- Constant Field Values
-
INNER_JOIN_FETCH
static final String INNER_JOIN_FETCH
The constant for 'INNER JOIN FETCH'.- See Also:
- Constant Field Values
-
INTERSECT
static final String INTERSECT
The constant for 'INTERSECT'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
IS
static final String IS
The constant for 'IS'.- See Also:
- Constant Field Values
-
IS_EMPTY
static final String IS_EMPTY
The constant for 'IS EMPTY'.- See Also:
- Constant Field Values
-
IS_NOT_EMPTY
static final String IS_NOT_EMPTY
The constant for 'IS NOT EMPTY'.- See Also:
- Constant Field Values
-
IS_NOT_NULL
static final String IS_NOT_NULL
The constant for 'IS NOT NULL'.- See Also:
- Constant Field Values
-
IS_NULL
static final String IS_NULL
The constant for 'IS NULL'.- See Also:
- Constant Field Values
-
JOIN
static final String JOIN
The constant for 'JOIN'.- See Also:
- Constant Field Values
-
JOIN_FETCH
static final String JOIN_FETCH
The constant for 'JOIN FETCH'.- See Also:
- Constant Field Values
-
KEY
static final String KEY
The constant for 'KEY'.- See Also:
- Constant Field Values
-
LAST
static final String LAST
The constant for 'LAST'.- See Also:
- Constant Field Values
- Since:
- 2.5
-
LEADING
static final String LEADING
The constant for 'LEADING'.- See Also:
- Constant Field Values
-
LEFT
static final String LEFT
The constant for 'LEFT'.- See Also:
- Constant Field Values
-
LEFT_JOIN
static final String LEFT_JOIN
The constant for 'LEFT JOIN'.- See Also:
- Constant Field Values
-
LEFT_JOIN_FETCH
static final String LEFT_JOIN_FETCH
The constant for 'LEFT JOIN FETCH'.- See Also:
- Constant Field Values
-
LEFT_OUTER_JOIN
static final String LEFT_OUTER_JOIN
The constant for 'LEFT OUTER JOIN'.- See Also:
- Constant Field Values
-
LEFT_OUTER_JOIN_FETCH
static final String LEFT_OUTER_JOIN_FETCH
The constant for 'LEFT OUTER JOIN FETCH'.- See Also:
- Constant Field Values
-
LENGTH
static final String LENGTH
The constant for 'LENGTH'.- See Also:
- Constant Field Values
-
LIKE
static final String LIKE
The constant for 'LIKE'.- See Also:
- Constant Field Values
-
LOCATE
static final String LOCATE
The constant for 'LOCATE'.- See Also:
- Constant Field Values
-
LOWER
static final String LOWER
The constant for 'LOWER'.- See Also:
- Constant Field Values
-
LOWER_THAN
static final String LOWER_THAN
The constant for '<'.- See Also:
- Constant Field Values
-
LOWER_THAN_OR_EQUAL
static final String LOWER_THAN_OR_EQUAL
The constant for '<='.- See Also:
- Constant Field Values
-
MAX
static final String MAX
The constant for 'MAX'.- See Also:
- Constant Field Values
-
MEMBER
static final String MEMBER
The constant for 'MEMBER'.- See Also:
- Constant Field Values
-
MEMBER_OF
static final String MEMBER_OF
The constant for 'MEMBER OF'.- See Also:
- Constant Field Values
-
MIN
static final String MIN
The constant for 'MIN'.- See Also:
- Constant Field Values
-
MINUS
static final String MINUS
The constant for the minus sign '-'.- See Also:
- Constant Field Values
-
MOD
static final String MOD
The constant for 'MOD'.- See Also:
- Constant Field Values
-
MULTIPLICATION
static final String MULTIPLICATION
The constant for multiplication sign '*'.- See Also:
- Constant Field Values
-
NAMED_PARAMETER
static final String NAMED_PARAMETER
The constant for ':'.- See Also:
- Constant Field Values
-
NEW
static final String NEW
The constant for 'NEW'.- See Also:
- Constant Field Values
-
NOT
static final String NOT
The constant for 'NOT'.- See Also:
- Constant Field Values
-
NOT_BETWEEN
static final String NOT_BETWEEN
The constant for 'NOT BETWEEN'.- See Also:
- Constant Field Values
-
NOT_EQUAL
static final String NOT_EQUAL
The constant for '!='.- See Also:
- Constant Field Values
- Since:
- 2.4
-
NOT_EXISTS
static final String NOT_EXISTS
The constant for 'NOT EXISTS'.- See Also:
- Constant Field Values
-
NOT_IN
static final String NOT_IN
The constant for 'NOT IN'.- See Also:
- Constant Field Values
-
NOT_LIKE
static final String NOT_LIKE
The constant for 'NOT LIKE'.- See Also:
- Constant Field Values
-
NOT_MEMBER
static final String NOT_MEMBER
The constant for 'NOT MEMBER'.- See Also:
- Constant Field Values
-
NOT_MEMBER_OF
static final String NOT_MEMBER_OF
The constant for 'NOT MEMBER OF'.- See Also:
- Constant Field Values
-
NULL
static final String NULL
The constant for 'NULL'.- See Also:
- Constant Field Values
-
NULLIF
static final String NULLIF
The constant for 'NULLIF'.- See Also:
- Constant Field Values
-
NULLS
static final String NULLS
The constant for 'NULLS'.- See Also:
- Constant Field Values
- Since:
- 2.5
-
NULLS_FIRST
static final String NULLS_FIRST
The constant for 'NULLS FIRST'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
NULLS_LAST
static final String NULLS_LAST
The constant for 'NULLS LAST'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
OBJECT
static final String OBJECT
The constant for 'OBJECT'.- See Also:
- Constant Field Values
-
OF
static final String OF
The constant for 'OF'.- See Also:
- Constant Field Values
-
ON
static final String ON
The constant for 'ON', which is an EclipseLink specific identifier that was added in version 2.4.- See Also:
- Constant Field Values
- Since:
- 2.4
-
OPERATOR
static final String OPERATOR
The constant 'OPERATOR', which is an EclipseLink specific identifier that was added in version 2.4.- See Also:
- Constant Field Values
- Since:
- 2.4
-
OR
static final String OR
The constant for 'OR'.- See Also:
- Constant Field Values
-
ORDER_BY
static final String ORDER_BY
The constant for 'ORDER BY'.- See Also:
- Constant Field Values
-
ORDER_SIBLINGS_BY
static final String ORDER_SIBLINGS_BY
The constant for 'ORDER SIBLINGS BY'.- See Also:
- Constant Field Values
- Since:
- 2.5
-
OUTER
static final String OUTER
The constant for 'OUTER'.- See Also:
- Constant Field Values
-
PLUS
static final String PLUS
The constant for for the plus sign '+'.- See Also:
- Constant Field Values
-
POSITION
static final String POSITION
The constant for 'POSITION', which is an unused keyword.- See Also:
- Constant Field Values
-
POSITIONAL_PARAMETER
static final String POSITIONAL_PARAMETER
The constant for '?'.- See Also:
- Constant Field Values
-
QUOTE
static final String QUOTE
The constant for single quote.- See Also:
- Constant Field Values
-
REGEXP
static final String REGEXP
The constant for 'REGEXP'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
SCN
static final String SCN
The constant for 'SCN'.- See Also:
- Constant Field Values
- Since:
- 2.5
-
SELECT
static final String SELECT
The constant for 'SELECT'.- See Also:
- Constant Field Values
-
SET
static final String SET
The constant for 'SET'.- See Also:
- Constant Field Values
-
SIZE
static final String SIZE
The constant for 'SIZE'.- See Also:
- Constant Field Values
-
SOME
static final String SOME
The constant for 'SOME'.- See Also:
- Constant Field Values
-
SQL
static final String SQL
The constant 'SQL', which is an EclipseLink specific identifier that was added in version 2.4.- See Also:
- Constant Field Values
- Since:
- 2.4
-
SQRT
static final String SQRT
The constant for 'SQRT'.- See Also:
- Constant Field Values
-
START_WITH
static final String START_WITH
The constant for 'WHERE'.- See Also:
- Constant Field Values
-
SUBSTRING
static final String SUBSTRING
The constant for 'SUBSTRING'.- See Also:
- Constant Field Values
-
SUM
static final String SUM
The constant for 'SUM'.- See Also:
- Constant Field Values
-
TABLE
static final String TABLE
The constant for 'TABLE'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
THEN
static final String THEN
The constant for 'THEN'.- See Also:
- Constant Field Values
-
TIMESTAMP
static final String TIMESTAMP
The constant for 'TIMESTAMP'.- See Also:
- Constant Field Values
- Since:
- 2.5
-
TRAILING
static final String TRAILING
The constant for 'TRAILING'.- See Also:
- Constant Field Values
-
TREAT
static final String TREAT
The constant for 'TREAT', which is an EclipseLink specific identifier that was added in version 2.1.- See Also:
- Constant Field Values
-
TRIM
static final String TRIM
The constant for 'TRIM'.- See Also:
- Constant Field Values
-
TRUE
static final String TRUE
The constant for 'TRUE'.- See Also:
- Constant Field Values
-
TYPE
static final String TYPE
The constant for 'TYPE'.- See Also:
- Constant Field Values
-
UNION
static final String UNION
The constant for 'UNION'.- See Also:
- Constant Field Values
- Since:
- 2.4
-
UNKNOWN
static final String UNKNOWN
The constant for 'UNKNOWN', which is an unused keyword.- See Also:
- Constant Field Values
-
UPDATE
static final String UPDATE
The constant for 'UPDATE'.- See Also:
- Constant Field Values
-
UPPER
static final String UPPER
The constant for 'UPPER'.- See Also:
- Constant Field Values
-
VALUE
static final String VALUE
The constant for 'VALUE'.- See Also:
- Constant Field Values
-
WHEN
static final String WHEN
The constant for the identifier 'WHEN'.- See Also:
- Constant Field Values
-
WHERE
static final String WHERE
The constant for 'WHERE'.- See Also:
- Constant Field Values
-
-
Method Detail
-
accept
void accept(ExpressionVisitor visitor)
Visits thisExpression
by the givenvisitor
.- Parameters:
visitor
- TheExpressionVisitor
to visit this object
-
acceptChildren
void acceptChildren(ExpressionVisitor visitor)
Visits the children of thisExpression
. This method can be used to optimize traversing the children since a new list is not created every timechildren()
is called.This does not traverse the
Expression
sub-hierarchy, use a subclass ofAbstractTraverseChildrenVisitor
in order to traverse the entire sub-hierarchy.- Parameters:
visitor
- Thevisitor
to visit the children of this object.
-
children
ListIterable<Expression> children()
Returns the children of thisExpression
.- Returns:
- The children of this
Expression
or an emptyListIterable
-
findQueryBNF
JPQLQueryBNF findQueryBNF(Expression expression)
Retrieves theJPQLQueryBNF
that represents the fragment of thisExpression
that was used when parsing the givenExpression
.- Parameters:
expression
- TheExpression
that is a descendant of this one- Returns:
- The
JPQLQueryBNF
that was used to parse the given expression - Since:
- 2.5
-
getGrammar
JPQLGrammar getGrammar()
Returns theJPQLGrammar
that defines how the JPQL query was parsed.- Returns:
- The
JPQLGrammar
that was used to parse thisExpression
- Since:
- 2.4
-
getLength
int getLength()
Returns the length of the string representation of thisExpression
, which is the length of the text generated bytoActualText()
.- Returns:
- The length of the string representation of this
Expression
- Since:
- 2.4
-
getOffset
int getOffset()
Returns the position of thisExpression
within its parent hierarchy.- Returns:
- The length of the string representation of what is coming before this object
- Since:
- 2.4
-
getParent
Expression getParent()
Returns the parent of thisExpression
.- Returns:
- The parent of this
Expression
, which is nevernull
except for the root of the tree
-
getQueryBNF
JPQLQueryBNF getQueryBNF()
Returns the BNF of thisExpression
.- Returns:
- The
JPQLQueryBNF
, which represents the grammar of thisExpression
- Since:
- 2.4
-
getRoot
JPQLExpression getRoot()
Retrieves the root node of the parsed tree hierarchy.- Returns:
- The root of the
Expression
tree
-
isAncestor
boolean isAncestor(Expression expression)
Determines whether thisExpression
is a parent of the givenExpression
.- Parameters:
expression
- TheExpression
to verify its paternity with thisExpression
- Returns:
true
if thisExpression
is the same as the givenExpression
or one of its parent;false
otherwise
-
orderedChildren
ListIterable<Expression> orderedChildren()
Returns the list representing thisExpression
and its children.- Returns:
- The
Expressions
representing thisExpression
-
populatePosition
void populatePosition(QueryPosition queryPosition, int position)
Retrieves theExpression
located at the given position using the actual query, which may have extra whitespace.- Parameters:
position
- The array has one element and is the position of theExpression
to retrieve
-
toActualText
String toActualText()
Generates a string representation of thisExpression
, which needs to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist.- Returns:
- The string representation of this
Expression
-
toParsedText
String toParsedText()
Returns a string representation of thisExpression
and its children. The expression should contain whitespace even if the beautified version would not have any. For instance, "SELECT e " should be returned wheretoParsedText()
would return "SELECT e".- Returns:
- The string representation of this
Expression
-
-