Defining a SELECT Clause

A SELECT clause is always required when you define an EJB QL query. It is the SELECT clause that determines the type of values returned by a query, so it must be consistent with the declaration of the select or finder method that it’s supporting. For a finder method, this means that the SELECT clause must always return the abstract schema type of the entity bean for which the method is defined. The container takes care of returning local or remote interface references as necessary. You’ve seen examples of SELECT clauses such as the following throughout this chapter:

SELECT OBJECT(auction) FROM EnglishAuction auction 

The SELECT clause in this example references a range variable associated with the EnglishAuction abstract ...

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.