Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andresetevejob/42a32532d1ba5529e6101144cb0af0ea to your computer and use it in GitHub Desktop.
Save andresetevejob/42a32532d1ba5529e6101144cb0af0ea 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