The J2EETM Tutorial
Home
TOC
Index
PREV TOP NEXT Search
Feedback

Enterprise JavaBeans Query Language

Dale Green

The Enterprise JavaBeans Query Language (EJB QL) defines the queries for the finder and select methods of an entity bean with container-managed persistence. A subset of SQL92, EJB QL has extensions that allow navigation over the relationships defined in an entity bean's abstract schema. The scope of an EJB QL query spans the abstract schemas of related entity beans that are packaged in the same EJB JAR file.

You define EJB QL queries in the deployment descriptor of the entity bean. Typically, a tool will translate these queries into the target language of the underlying data store. Because of this translation, entity beans with container-managed persistence are portable--their code is not tied to a specific type of data store.

This chapter relies on the material presented in earlier chapters. For conceptual information, see the section Container-Managed Persistence. For code examples, see Chapter 6.

In This Chapter

Terminology
Simplified Syntax
Example Queries
Simple Finder Queries
Finder Queries That Navigate to Related Beans
Finder Queries with Other Conditional Expressions
Select Queries
Full Syntax
BNF Grammar of EJB QL
BNF Symbols
FROM Clause
Path Expressions
WHERE Clause
SELECT Clause
EJB QL Restrictions
Home
TOC
Index
PREV TOP NEXT Search
Feedback