Note that the packages that are used to hold the generated Java™ types are not deleted with the associated enterprise bean. You must manually delete unused packages from your project when the generated classes in those packages are removed.
You can delete some or all of the artifacts that compose an enterprise bean:
If you delete the EJB metadata from the deployment descriptor, the generated access bean classes and deployment code will also be deleted because they cannot exist without the bean classes. If you delete an enterprise bean using the EJB editor (or while an EJB editor is open), the delete is not committed until the editor is saved. Therefore, if you close the editor without saving, the enterprise bean remains and the deleted Java files are returned.
When an EJB is deleted, all of the metadata that is associated with the bean is also deleted, including metadata from the bindings and extension documents.
To delete enterprise beans, access beans, or deployment code: