Prepare persistence applications to test outside of the application server container in a Java SE environment.
For this task, you must specify the com.ibm.ws.jpa.thinclient_8.0.0.jar stand-alone Java archive (JAR) file in your class path. This stand-alone JAR file is available from the installation images. The location of this file on the server installation image is ${app_server_root}/runtimes/com.ibm.ws.jpa.thinclient_8.0.0.jar..
The following is a sample persistence.xml file for the Java SE Environment:
<?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="TheWildZooPU" transaction-type="RESOURCE_LOCAL"> <!-- additional Mapping file, in addition to orm.xml> <mapping-file>META-INF/JPAorm.xml</mapping-file> <class>com.company.bean.jpa.PersistebleObjectImpl</class> <class>com.company.bean.jpa.Animal</class> <class>com.company.bean.jpa.Dog</class> <class>com.company.bean.jpa.Cat</class> <properties> <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver" /> <property name="openjpa.ConnectionURL" value="jdbc:derby:target/database/jpa-test-database;create=true" /> <property name="openjpa.Log" value="DefaultLevel=INFO,SQL=TRACE,File=./dist/jpaEnhancerLog.log,Runtime=INFO,Tool=INFO" /> <property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=72" /> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" /> <property name="openjpa.ConnectionUserName" value="user" /> <property name="openjpa.ConnectionPassword" value="password"/> </properties> </persistence-unit> </persistence>
In this information ...Related tasks
Related reference
| IBM Redbooks, demos, education, and more(Index) |