Skip to content

Instantly share code, notes, and snippets.

@gerrymclarnon
Created January 24, 2013 23:20
Show Gist options
  • Save gerrymclarnon/4629416 to your computer and use it in GitHub Desktop.
Save gerrymclarnon/4629416 to your computer and use it in GitHub Desktop.
A TomEE 1.5 persistence unit example using EclipseLink as the JPA provider. The data source is defined in a resources.xml file, an example of which can be found here... https://gist.github.com/4629327.
<?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="CustomerDBSpringPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/sample</jta-data-source>
<class>customerdb.Customer</class>
<class>customerdb.DiscountCode</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment