Finder/Select Methods

Enterprise Bean (with Container Managed Persistence 2.0) -> Entity tabbed pane -> Find/Select Queries button

The EJB QL statements for the finder and select methods of an entity bean with container-managed persistence are specified in the Finder/Select Methods dialog.

Finder methods allow the results of an EJB QL query to be used by the clients of the entity bean. Finder methods are defined in the home interface(s) of an entity bean and return entity objects or local entity objects.

Select methods allow the Bean Provider to use EJB QL to find objects or values related to the state of an entity bean without directly exposing the results to the client. Selected methods are typically used to select the persistent state of an entity object or to select entities that are related to the entity bean for which the query is defined.

  1. Select the finder method. Select the radio button in the Show list for the interface/class to which the method belongs. The methods table will be updated to show the methods in the interface.
  2. Choose the method for which you are defining the query.
  3. Check the Prefetch Disabled box, if you do not want related beans to be fetched while executing a query for this finder or selector.
  4. In the "EJB-QL Query" box, enter the statement that implements the query.
  5. Select the type of EJBs that will be returned by the query from the Return EJBs of Type drop-down list.

Legal Notices