Simplified Syntax

This section briefly describes the syntax of EJB QL so that you can quickly move on to the next section, Example Queries. When you are ready to learn about the syntax in more detail, see the section Full Syntax (page 1022).

An EJB QL query has four clauses: SELECT, FROM, WHERE, and ORDER BY. The SELECT and FROM clauses are required, but the WHERE and ORDER BY clauses are optional. Here is the high-level BNF syntax of an EJB QL query:

EJB QL ::= select_clause from_clause [where_clause][orderby_clause]

The SELECT clause defines the types of the objects or values returned by the query. A return type is either a local interface, a remote interface, or a persistent field.

The FROM clause defines the scope of the query by declaring ...

Get The J2EE™ Tutorial Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.