background image

BNF Grammar of the Java Persistence Query

<< Bulk Updates and Deletes | Association Path Expression >>
<< Bulk Updates and Deletes | Association Path Expression >>

BNF Grammar of the Java Persistence Query

TABLE 27­1
BNF Symbol Summary
(Continued)
Symbol
Description
[...]
The constructs within the square brackets are optional.
|
An exclusive OR.
BOLDFACE
A keyword (although capitalized in the BNF diagram, keywords are not case-sensitive).
White space
A white space character can be a space, a horizontal tab, or a line feed.
BNF Grammar of the Java Persistence Query Language
Here is the entire BNF diagram for the query language:
QL_statement ::= select_statement | update_statement | delete_statement
select_statement ::= select_clause from_clause [where_clause] [groupby_clause]
[having_clause] [orderby_clause]
update_statement ::= update_clause [where_clause]
delete_statement ::= delete_clause [where_clause]
from_clause ::=
FROM identification_variable_declaration
{, {identification_variable_declaration |
collection_member_declaration}}*
identification_variable_declaration ::=
range_variable_declaration { join | fetch_join }*
range_variable_declaration ::= abstract_schema_name [AS]
identification_variable
join ::= join_spec join_association_path_expression [AS]
identification_variable
fetch_join ::= join_specFETCH join_association_path_expression
association_path_expression ::=
collection_valued_path_expression |
single_valued_association_path_expression
join_spec::= [LEFT [OUTER] |INNER] JOIN
join_association_path_expression ::=
join_collection_valued_path_expression |
join_single_valued_association_path_expression
join_collection_valued_path_expression::=
identification_variable.collection_valued_association_field
join_single_valued_association_path_expression::=
identification_variable.single_valued_association_field
collection_member_declaration ::=
IN (collection_valued_path_expression) [AS]
identification_variable
single_valued_path_expression ::=
state_field_path_expression |
single_valued_association_path_expression
Full Query Language Syntax
Chapter 27 · The Java Persistence Query Language
741