Note that there are some explanatory texts on larger screens.

plurals
  1. PODDL generation and general persistence.xml settings (OpenJPA)
    primarykey
    data
    text
    <p><strong>Summary</strong></p> <p>I'm trying to run a Java web application JPA 2.0 example. The <a href="http://docs.oracle.com/javaee/6/tutorial/doc/giqst.html" rel="noreferrer">example application</a> was written to run in <code>Glassfish</code>, using <code>EclipseLink</code> as JPA provider. I would like to convert it to run in <code>TomEE</code> with <code>OpenJPA</code> as the JPA provider, but I can't any detailed tutorials for getting up and running with <code>OpenJPA</code>.</p> <p><strong>Problem</strong></p> <p>I'm having trouble converting <code>persistence.xml</code> to work with <code>OpenJPA</code> instead of <code>EclipseLink</code>. More specifically, the given <code>persistence.xml</code> doesn't specify:</p> <ul> <li><code>Entity</code> classes. Are these necessary?</li> <li>The desired JPA provider. Will the container default to something?</li> <li>The JDBC driver. How do I specify an "in-memory" DB (just for initial testing purposes)?</li> </ul> <p>Also:</p> <ul> <li>How are the DDL generation properties expressed in OpenJPA? I wasn't able to find them the <a href="http://openjpa.apache.org/builds/2.2.0/apache-openjpa/docs/manual.html" rel="noreferrer">OpenJPA User Guide</a>.</li> </ul> <p><strong>Details</strong></p> <p>Below is the EclipseLink <code>persistence.xml</code>:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/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_2_0.xsd"&gt; &lt;persistence-unit name="order" transaction-type="JTA"&gt; &lt;jta-data-source&gt;jdbc/__default&lt;/jta-data-source&gt; &lt;properties&gt; &lt;property name="eclipselink.ddl-generation" value="drop-and-create-tables" /&gt; &lt;property name="eclipselink.ddl-generation.output-mode" value="both" /&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre> <p>I have the following <code>Entity</code> classes:</p> <ul> <li><code>order.entity.LineItem</code></li> <li><code>order.entity.LineItemKey</code></li> <li><code>order.entity.Order</code></li> <li><code>order.entity.Part</code></li> <li><code>order.entity.PartKey</code></li> <li><code>order.entity.Vendor</code></li> <li><code>order.entity.VendorPart</code></li> </ul> <p><strong>Question</strong></p> <ul> <li>Does anyone know what the equivalent persistence.xml would look like for OpenJPA?</li> <li>Alternatively, if anyone could point me to an OpenJPA tutorial that covers these issues that would be just as good</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload