Developing Enterprise JavaBean Applications

JDeveloper provides powerful tools for creating, modifying, and deploying J2EE-compliant Enterprise JavaBeans (EJBs). Note: If you are creating a web-based application, see Developing a Web-based EJB Application and see the topics in Working With the Oracle Application Development Framework.

To develop EJBs in JDeveloper:

  1. Create EJBs on a Diagram
  2. Edit the EJB with the EJB Module Editor
  3. Add business logic with the Code Editor
  4. Test the EJB using the embedded OC4J Server
  5. Deploy the EJB
  6. Test the EJB remotely
  7. Register Business Services with Oracle ADF Data Controls

These steps are examined in closer detail below.

Creating EJBs on a Diagram

For creating EJBs visually, JDeveloper provides support for modeling EJBs, relationships, references, properties and methods on a diagram.

For more information on modeling EJBs, see the topic, Modeling Enterprise JavaBeans.

Creating EJBs with the EJB Wizards

The modeling tools are linked to the EJB wizards. The Enterprise JavaBean wizards can also be used independently to create any type of EJB, while the Create CMP Entity Beans from Tables Wizard is used specifically for reverse-engineering CMP entity EJBs from database tables.

Editing the EJB with the EJB Module Editor

If you are using a class model, you may find that the easiest way to edit an EJB is using the modeler's interface. You will also need to use the EJB Module Editor. The EJB Module Editor is a GUI interface used for modifying Java (and sometimes XML) code in your EJB. By modifying the EJB through this editor, changes within the EJB's classes are synchronized.

For more information on using the EJB Module Editor, see the topic, Modifying EJB Properties. Also, you can get context-sensitive help by pressing the F1 key or clicking the Help button when using the EJB Module Editor.

Adding Business Logic with the Code Editor

After you have added methods using the EJB Module Editor, you can implement their behavior in the Code Editor.

Testing the EJB Using the Embedded OC4J Server

To test your EJBs you need to run a client program that can call methods on the EJB. JDeveloper provides a sample client utility that will help you create clients quickly. You can then run and test EJBs using the embedded OC4J Server, which simplifies the process. The embedded OC4J server runs within JDeveloper. You do not need to create a deployment profile to use this server, nor do you have to initialize it. After you test your EJBs locally, you can deploy them remotely with no further changes.

Deploying the EJB

Oracle10g provides OC4J as a container for EJBs. An OC4J-specific deployment profile is generated by default. You can also create a WebLogic-specific deployment profile. Information on EJB deployment can be found in the topic Packaging EJBs for Deployment.

Testing the EJB Remotely

JDeveloper can also create a sample client for use with a remote server. You generate the sample client in the same manner as a local client, providing the remote connection details.

For more information, see the topic Running and Testing an EJB.

Registering Business Services with Oracle ADF Data Controls

To bind EJBs to the ADF data control, see Registering Business Services with Oracle ADF Data Controls.


Related topics

Creating a Diagram of Enterprise JavaBeans
About EJB Files Generated by JDeveloper

Using Business Component Entity Facades

 

 

Copyright © 1997, 2004, Oracle. All rights reserved.