Adding EJB QL to a Finder or Select Method

See Also

EJB QL is the generic query language used by EJB 2.1 finder methods and select methods, the two types of entity bean query methods. You must use EJB QL to define queries that these methods use to return data. When you deploy the bean containing a finder or select method, the application container translates your generic EJB QL to the persistence mapping made by the container (for example, the version of SQL required to access the SQL databases associated with the container).

Finder methods are unique to entity beans because entity beans represent data in a database that can be identified and found. A finder method can find and return an entity bean or a collection or set of entity beans.

Select methods are unique to entity beans that use container-managed persistence (CMP beans). A select method is more flexible than a finder method and is visible only to the bean class, and therefore can be used only by methods of the bean class. In addition to returning a bean or a collection of beans, a select method can also return the value of a field.

To add or edit the EJB QL in a finder method or select method, do one of the following:

See Also
About Entity Beans
Defining a Select Method
Defining a Finder Method
Defining a Business Method
Defining a CMP Field
Generating CMP Entity Beans from a Database

Legal Notices