Created
July 2, 2015 20:54
-
-
Save kevinhooke/85d5b2d5864fd9835cc4 to your computer and use it in GitHub Desktop.
Standalone persistence.xml against MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | |
<persistence-unit name="TestPU" transaction-type="RESOURCE_LOCAL"> | |
<provider>org.hibernate.ejb.HibernatePersistence</provider> | |
<class>list entities here if running as standalone app</class> | |
<properties> | |
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> | |
<property name="hibernate.connection.url" value="jdbc:mysql://localhost/test"/> | |
<property name="hibernate.connection.username" value="test"/> | |
<property name="hibernate.connection.password" value="test"/> | |
<property name="hibernate.hbm2ddl.auto" value="create" /> <!-- remove this if not creating tables at init --> | |
<property name="hibernate.show_sql" value="true" /> | |
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" /> | |
</properties> | |
</persistence-unit> | |
</persistence> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment