Building an EJB 3.0 Persistence Model with Oracle JDeveloper

September 5, 2010

EJB 3.0

«»

Creating an EJB 3.0 application

In this section, we create an EJB 3.0 application in JDeveloper. Select New Application.



Specify an Application Name, select the Java EE Web Application template, which
consists of a Model project and a ViewController project, and click on Next.



Next, specify the name (EJB3ViewController) for the View and Controller project.
In the Project Technologies tab, transfer the EJB project technology from the
Available list to the Selected list using the > button. We have selected the EJB project
technology, as we shall be creating an EJB 3.0 model. Click on Next.



Select the default Java settings for the View project and click on Next.



Configure the EJB Settings for the View project. Select EJB Version as Enterprise
JavaBeans 3.0
and select Using Annotations. Click on Next. Next, create the Model
project. Specify the Project Name (EJB3Model for example), and in the Project
Technologies
tab transfer the EJB project technology from the Available list to the
Selected list using the > button. We have added the EJB project technology, as the
EJB 3.0 application client is created in the View project. Click on Next.



Select the default Java settings for the Model project and click on Next.



Similar to the View project, configure the EJB settings for the Model project. Select
EJB Version as Enterprise JavaBeans 3.0, select Using Annotations and click on
Finish. As we won’t be using a jndi.properties file or an ejb-jar.xml file , we
don’t need to select the generate option for the jndi.properties file and the
ejb-jar.xml file.



An EJB 3.0 application, which consists of a Model project and a ViewController
project, get added in the Application tab.



Select the EJB3Model project in the Application navigator and select Tools | Project
Properties
. In the Project Properties window, select the Libraries and Classpath
node. The EJB 3.0 library should be in the Classpath Entries.



Select the EJB Module node and select the OracleDBConnection in the Connection
drop-down list. The datasource corresponding to the OracleDBConnection is jdbc/
OracleDBConnectionDS
.


EJB 3.0 Articles

email

«»

Comments

comments