Adding methods to the home interface

You can use the Java™ editor to add a new home method.

About this task

Only BMP entity beans allow ejbFind methods to be promoted to the home interface. Once promoted, the method name begins with "find" and it throws the javax.ejb.FinderException and javax.ejb.RemoteException. Both BMP and CMP beans allow ejbCreate<METHOD> methods to be promoted. Once promoted, the method name is "create" and it throws the javax.ejb.CreateException and the javax.ejb.RemoteException (javax.ejb.RemoteException is not added for the local home interface). Also, comments for the methods in the bean are promoted as well (both to the home and remote interfaces).

Procedure

  1. Open the Java editor in one of the following ways:
    • In the Enterprise Explorer view of the Java EE perspective, right-click the Java file for the bean class that contains the method to be promoted, and select Open with > Java Editor.
    • In the Enterprise Explorer view of the Java EE perspective, expand the EJB module, then double-click the desired .java file.
    • On the Bean page of the deployment descriptor editor, in the Class and Interface Files section, select the desired class and click Open.
  2. Type the method into the bean class.
  3. Save your changes and close the editor.

Feedback