Java Reference
In-Depth Information
The entity Persistence Configuration file
The persistence.xml file is used to define the persistence unit/s, which includes
a JTA data source that is used for database persistence. The persistence provider is
specified as org.eclipse.persistence.jpa.PersistenceProvider . The jta-
data-source is defined as java:/app/jdbc/jdbc/OracleDBConnectionDS . The property is specified as WebLogic_10 . The javax.
persistence.jtaDataSource property is specified as java:/app/jdbc/jdbc/
OracleDBConnectionDS . The java:/app/jdbc prefix gets added to the JTA Data
Source specified when creating the persistence unit. Remove the java:/app/jdbc
prefix as we are using an external WebLogic server, not the integrated WebLogic
server. The persistence.xml configuration file is listed as follows:
<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns=""
<persistence-unit name="em">
<property name="eclipselink.ddl-generation" value="none" />
<property name=""
value="WebLogic_10" />
<property name="javax.persistence.jtaDataSource"
value="jdbc/OracleDBConnectionDS" />
<property name=""
value="Oracle10g" />
Creating a stateless session bean
As we already discussed, it's always a good practice to create a session bean fa├žade
for an entity bean. This is done to ensure that the entity bean is not directly accessed
by a client. To create a session bean, follow the given steps:
Select the EJB3Model project and select File | New .
In the New Gallery window, select Categories | Business Tier | EJB and
Items | Session EJB . Click on OK .
Search WWH ::

Custom Search