Adding methods to the home interface

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

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 will be promoted as well (both to the home and remote interfaces).

To add a new home method:

  1. Open the Java editor in one of the following ways:
    • In the Project Explorer view of the J2EE 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 Project Explorer view of the J2EE 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. The class opens in the Java editor.
  2. Type the method into the bean class.
  3. Save your changes and close the editor.
Related tasks
Working with a bean's client interface methods
Promoting methods to an interface
Demoting methods from an interface

Feedback