public interface Expression
JPQL 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.
JPQLGrammar
Modifier and Type | Field and 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'.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(ExpressionVisitor visitor)
Visits this
Expression by the given visitor . |
void |
acceptChildren(ExpressionVisitor visitor)
Visits the children of this
Expression . |
ListIterable<Expression> |
children()
Returns the children of this
Expression . |
JPQLQueryBNF |
findQueryBNF(Expression expression)
Retrieves the
JPQLQueryBNF that represents the fragment of this Expression
that was used when parsing the given Expression . |
JPQLGrammar |
getGrammar()
Returns the
JPQLGrammar that defines how the JPQL query was parsed. |
int |
getLength()
Returns the length of the string representation of this
Expression , which is the
length of the text generated by toActualText() . |
int |
getOffset()
Returns the position of this
Expression within its parent hierarchy. |
Expression |
getParent()
Returns the parent of this
Expression . |
JPQLQueryBNF |
getQueryBNF()
Returns the BNF of this
Expression . |
JPQLExpression |
getRoot()
Retrieves the root node of the parsed tree hierarchy.
|
boolean |
isAncestor(Expression expression)
Determines whether this
Expression is a parent of the given Expression . |
ListIterable<Expression> |
orderedChildren()
Returns the list representing this
Expression and its children. |
void |
populatePosition(QueryPosition queryPosition,
int position)
Retrieves the
Expression located at the given position using the actual query,
which may have extra whitespace. |
String |
toActualText()
Generates a string representation of this
Expression , which needs to include any
characters that are considered virtual, i.e. |
String |
toParsedText()
Returns a string representation of this
Expression and its children. |
static final String ABS
static final String ALL
static final String AND
static final String ANY
static final String AS
static final String AS_OF
static final String ASC
static final String AVG
static final String BETWEEN
static final String BIT_LENGTH
static final String BOTH
static final String CASE
static final String CAST
static final String CHAR_LENGTH
static final String CHARACTER_LENGTH
static final String CLASS
static final String COALESCE
static final String COLUMN
static final String CONCAT
static final String CONNECT_BY
static final String COUNT
static final String CURRENT_DATE
static final String CURRENT_TIME
static final String CURRENT_TIMESTAMP
static final String DELETE
static final String DELETE_FROM
static final String DESC
static final String DIFFERENT
static final String DISTINCT
static final String DIVISION
static final String ELSE
static final String EMPTY
static final String END
static final String ENTRY
static final String EQUAL
static final String ESCAPE
static final String EXCEPT
static final String EXISTS
static final String EXTRACT
static final String FALSE
static final String FETCH
static final String FIRST
static final String FROM
static final String FUNC
static final String FUNCTION
static final String GREATER_THAN
static final String GREATER_THAN_OR_EQUAL
static final String GROUP_BY
static final String HAVING
static final String IN
static final String INDEX
static final String INNER
static final String INNER_JOIN
static final String INNER_JOIN_FETCH
static final String INTERSECT
static final String IS
static final String IS_EMPTY
static final String IS_NOT_EMPTY
static final String IS_NOT_NULL
static final String IS_NULL
static final String JOIN
static final String JOIN_FETCH
static final String KEY
static final String LAST
static final String LEADING
static final String LEFT
static final String LEFT_JOIN
static final String LEFT_JOIN_FETCH
static final String LEFT_OUTER_JOIN
static final String LEFT_OUTER_JOIN_FETCH
static final String LENGTH
static final String LIKE
static final String LOCATE
static final String LOWER
static final String LOWER_THAN
static final String LOWER_THAN_OR_EQUAL
static final String MAX
static final String MEMBER
static final String MEMBER_OF
static final String MIN
static final String MINUS
static final String MOD
static final String MULTIPLICATION
static final String NAMED_PARAMETER
static final String NEW
static final String NOT
static final String NOT_BETWEEN
static final String NOT_EQUAL
static final String NOT_EXISTS
static final String NOT_IN
static final String NOT_LIKE
static final String NOT_MEMBER
static final String NOT_MEMBER_OF
static final String NULL
static final String NULLIF
static final String NULLS
static final String NULLS_FIRST
static final String NULLS_LAST
static final String OBJECT
static final String OF
static final String ON
static final String OPERATOR
static final String OR
static final String ORDER_BY
static final String ORDER_SIBLINGS_BY
static final String OUTER
static final String PLUS
static final String POSITION
static final String POSITIONAL_PARAMETER
static final String QUOTE
static final String REGEXP
static final String SCN
static final String SELECT
static final String SET
static final String SIZE
static final String SOME
static final String SQL
static final String SQRT
static final String START_WITH
static final String SUBSTRING
static final String SUM
static final String TABLE
static final String THEN
static final String TIMESTAMP
static final String TRAILING
static final String TREAT
static final String TRIM
static final String TRUE
static final String TYPE
static final String UNION
static final String UNKNOWN
static final String UPDATE
static final String UPPER
static final String VALUE
static final String WHEN
static final String WHERE
void accept(ExpressionVisitor visitor)
Expression
by the given visitor
.visitor
- The ExpressionVisitor
to visit this objectvoid acceptChildren(ExpressionVisitor visitor)
Expression
. This method can be used to optimize traversing
the children since a new list is not created every time children()
is called.
This does not traverse the Expression
sub-hierarchy, use a subclass of
AbstractTraverseChildrenVisitor
in order to traverse the entire sub-hierarchy.
visitor
- The visitor
to visit the children of this object.ListIterable<Expression> children()
Expression
.Expression
or an empty ListIterable
JPQLQueryBNF findQueryBNF(Expression expression)
JPQLQueryBNF
that represents the fragment of this Expression
that was used when parsing the given Expression
.expression
- The Expression
that is a descendant of this oneJPQLQueryBNF
that was used to parse the given expressionJPQLGrammar getGrammar()
JPQLGrammar
that defines how the JPQL query was parsed.JPQLGrammar
that was used to parse this Expression
int getLength()
Expression
, which is the
length of the text generated by toActualText()
.Expression
int getOffset()
Expression
within its parent hierarchy.Expression getParent()
Expression
.Expression
, which is never null
except for the
root of the treeJPQLQueryBNF getQueryBNF()
Expression
.JPQLQueryBNF
, which represents the grammar of this Expression
JPQLExpression getRoot()
Expression
treeboolean isAncestor(Expression expression)
Expression
is a parent of the given Expression
.expression
- The Expression
to verify its paternity with this Expression
true
if this Expression
is the same as the given Expression
or one of its parent; false
otherwiseListIterable<Expression> orderedChildren()
Expression
and its children.Expressions
representing this Expression
void populatePosition(QueryPosition queryPosition, int position)
Expression
located at the given position using the actual query,
which may have extra whitespace.position
- The array has one element and is the position of the Expression
to retrieveString toActualText()
Expression
, 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.Expression
String toParsedText()
Expression
and its children. The expression
should contain whitespace even if the beautified version would not have any. For instance,
"SELECT e " should be returned where toParsedText()
would return "SELECT e".Expression
Copyright © 2007–2020 Eclipse.org - EclipseLink Project. All rights reserved.