Refactoring an Enterprise Bean
See Also
Refactoring is especially useful in EJB modules, since changing the name of
one method often means you have to update the name in all of the related interfaces,
deployment descriptors, and dependent classes and servlets.
To refactor an EJB module:
- Right-click a piece of code in the Source Editor and choose from the Refactor
submenu in the pop-up menu.
Notes:
- You cannot move an enterprise bean or any of its classes and interfaces
to a different project. The Move Class command only lets you move bean classes
and interfaces to different packages in the same EJB module.
- You cannot rename mandatory EJB infrastructure methods such as ejbCreate.
- In EJB 1.4 enterprise beans, when you use refactoring to perform actions such as
deleting a bean, renaming a field or finder method, the IDE does not update the deployment descriptor.
You have to update the deployment descriptor manually.
- In CMP entity beans, you cannot run the Encapsulate Field command on a field
that is registered as the bean's primary key.
- When you rename a Web service endpoint interface, the IDE updates the corresponding
WSDL file.
- When you rename a CMP field, the EJB QL statements for the field still refer
to the old names. You have to change the EJB QL statements manually.
- When deleting a code element, you can use the Safely Delete refactoring command to
help check for references to that element before making the changes.
- See Also
- About Refactoring
- Defining a Finder Method
- Defining a Select Method
- Defining a CMP Field
- Configuring EJB Deployment Descriptors
Legal Notices