Skip to content

Instantly share code, notes, and snippets.

@hoandang
Created February 25, 2013 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hoandang/5030741 to your computer and use it in GitHub Desktop.
Save hoandang/5030741 to your computer and use it in GitHub Desktop.
Struts 2 Persistence.xml OpenJPA
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.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_1_0.xsd">
<persistence-unit name="shop">
<provider>
org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<class>com.hoan.models.Category</class>
<class>com.hoan.models.Product</class>
<properties>
<property name = "openjpa.RuntimeUnenhancedClasses" value = "unsupported"/>
<property name = "openjpa.DataCache" value = "true"/>
<property name = "openjpa.QueryCache" value = "true"/>
<property name = "openjpa.ConnectionURL" value = "jdbc:mysql://localhost:3306/shop" />
<property name = "openjpa.ConnectionUserName" value = "root" />
<property name = "openjpa.ConnectionPassword" value = "password" />
<property name = "openjpa.ConnectionDriverName" value = "com.mysql.jdbc.Driver" />
<property name = "openjpa.AutoDetach" value="close, commit, nontx-read"/>
</properties>
</persistence-unit>
</persistence>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment