Working with Enterprise Beans

The following table shows how to work with enterprise beans.
Number one
Create the EJB module project
  1. Register a J2EE application server. You cannot deploy EJB modules to the Tomcat server.
  2. Create the project for the EJB module.
  3. Add the EJB module to an enterprise application.

Number two
Code the enterprise beans
  1. Create the enterprise beans.
  2. For Java EE 5 applications, use Java Persistence to access databases.
  3. For J2EE 1.4 applications, use EJB 2.1 entity beans to access databases. You can create empty entity beans or generate CMP entity beans from an existing database.
  4. Call enterprise beans from web application modules and other enterprise beans.
  5. Add business methods to your enterprise beans.
  6. Add select methods and finder methods to your entity beans.
  7. Use server resources like databases and JMS messages.

Number three
Configure the application
  1. Edit the EJB module's deployment descriptors.
  2. Configure container-managed relationships between enterprise beans.

Number four
Build the project
  1. Choose Build > Build Main Project or right-click the project and choose Build Project.

Number five
Deploy the module
  1. For stand-alone EJB modules, right-click the EJB module's project node and choose Run Project.
  2. For EJB modules that are part of an enterprise application, right-click the enterprise application and choose Run Project.

Legal Notices