Download
FAQ History |
API
Search Feedback |
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.
An EJB QL query has four clauses:
SELECT
,FROM
,WHERE
, andORDER BY
. TheSELECT
andFROM
clauses are required, but theWHERE
andORDER BY
clauses are optional. Here is the high-level BNF syntax of an EJB QL query: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 one or more identification variables, which can be referenced in theSELECT
andWHERE
clauses. An identification variable represents one of the following elements:The
WHERE
clause is a conditional expression that restricts the objects or values retrieved by the query. Although it is optional, most queries have aWHERE
clause.The
ORDER BY
clause sorts the objects or values returned by the query into a specified order.
Download
FAQ History |
API
Search Feedback |
All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.