<<>Summary
I m trying to run a Java web application JPA 2.0 example. The example application was written to run in Glassfish
, using EclipseLink
as JPA provider.
I would like to convert it to run in TomEE
with OpenJPA
as the JPA provider, but I can t any detailed tutorials for getting up and running with OpenJPA
.
<><>Problem>
页: 1 更具体地说,<代码>persistence.xml 注
Entity
classes. Are these necessary?- The desired JPA provider. Will the container default to something?
- The JDBC driver. How do I specify an "in-memory" DB (just for initial testing purposes)?
此外:
- How are the DDL generation properties expressed in OpenJPA? I wasn t able to find them the OpenJPA User Guide.
<> 详情>
下面是EclipseLinkpersistence.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<persistence-unit name="order" transaction-type="JTA">
<jta-data-source>jdbc/__default</jta-data-source>
<properties>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
<property name="eclipselink.ddl-generation.output-mode"
value="both" />
</properties>
</persistence-unit>
</persistence>
我有以下<密码>:
order.entity.LineItem
order.entity.LineItemKey
order.entity.Order
order.entity.Part
order.entity.PartKey
order.entity.Vendor
order.entity.VendorPart
<<><><><><>>>>><><><>>>>>
- Does anyone know what the equivalent persistence.xml would look like for OpenJPA?
- Alternatively, if anyone could point me to an OpenJPA tutorial that covers these issues that would be just as good