|
Home TOC Index |
|
Search
Feedback |
Simplified Syntax
This section briefly describes the syntax of EJB QL so that you can quickly move on to the 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 three clauses:
SELECT,FROM, andWHERE. TheSELECTandFROMclauses are required, but theWHEREclause is optional. Here is the high-level BNF syntax of an EJB QL query:EJB QL :: = select_clause from_clause [where_clause]The
SELECTclause 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
FROMclause defines the scope of the query by declaring one or more identification variables, which may be referenced in theSELECTandWHEREclauses. An identification variable represents one of the following elements:
- The abstract schema name of an entity bean
- A member of a collection that is the multiple side of a one-to-many relationship
The
WHEREclause is a conditional expression that restricts the objects or values retrieved by the query. Although optional, most queries have aWHEREclause.
|
Home TOC Index |
|
Search
Feedback |