Defining a FROM Clause

The SELECT and FROM clauses of a query are always required. A WHERE clause is part of most queries, but if the results don’t need to be restricted based on a conditional expression, one isn’t required. The FROM clause determines to which entities a query applies, so it’s the part you need to understand first.

From the basics of SQL, you know that a FROM clause identifies the tables from which a query pulls its results. Carrying this concept over to the object world defines what a FROM clause does in EJB QL. It defines the classes associated with a query. To be technical, a FROM clause defines the domain of objects to which a query applies.

The simplest type of query is one that retrieves all the objects of a given type. ...

Get Special Edition Using Enterprise JavaBeans™ 2.0 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.