Java Reference
In-Depth Information
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
The
persistence.xml
file is used to define the persistence unit/s, which include
a JTA datasource 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
eclipselink.target-server
property is specified as
WebLogic_10
. The
javax.
persistence.jtaDataSource
property is specified as
java:/app/jdbc/jdbc/
OracleDBConnectionDS
, which is just the default mapping JDeveloper uses for the
JTA Data Source. The
java:/app/jdbc
prefix gets added to the JTA Data Source
specified when creating the persistence unit. The
persistence.xml
configuration
file is listed next:
<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/
persistence_1_0.xsd"
version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="em">
<provider>
org.eclipse.persistence.jpa.PersistenceProvider
</provider>
<jta-data-source>
java:/app/jdbc/jdbc/OracleDBConnectionDS
</jta-data-source>
<class>
model.Catalog
</class>
<properties>
<property name="eclipselink.target-server" value="WebLogic_10"
/>
<property name="javax.persistence.jtaDataSource"
value="java:/app/jdbc/jdbc/OracleDBConnectionDS" />
</properties>
</persistence-unit>
</persistence>
Search WWH ::
Custom Search