How Do I: Add a Select Method to an Entity Bean?

A select method, like a finder method, uses EJB QL or WebLogic QL queries. Unlike find methods, select methods can only be used internally by the entity bean and are never defined in the bean's interfaces. A select method is declared as an abstract method in the CMP entity bean class, and has an @ejbgen:select tag describing the associated query.

To Add a Select Method

  1. Make sure that the entity bean is displayed in Design View.
  2. Right-click the right-hand area of the bean, and choose Add EJBSelect. The Add EJBSelect dialog appears.
  3. Enter the correct method name and signature. Remember that the method name must have the ejbSelect prefix.
  4. Enter EJB QL or WebLogic QL query syntax. Click OK. For more information on this query syntax, see Query Methods and EJB QL.
  5. Click the method name to examine the code in Source View.

Related Topics

How Do I: Add a Home Method to an Entity Bean?

How Do I: Add a Finder Method to an Entity Bean?

Query Methods and EJB QL

Developing Enterprise JavaBeans