Skip to content

Instantly share code, notes, and snippets.

@ezhov-da
Last active March 10, 2019 12:22
Show Gist options
  • Save ezhov-da/2372d2961a7db8aa206cd437ebcc5061 to your computer and use it in GitHub Desktop.
Save ezhov-da/2372d2961a7db8aa206cd437ebcc5061 to your computer and use it in GitHub Desktop.
java jpa persistance.xml h2db inmemory
https://memorynotfound.com/unit-test-jpa-junit-in-memory-h2-database/
[code:]XML[:code]<persistence xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd&quot;
version=&quot;2.0&quot;>
<persistence-unit name=&quot;ru.tander.bpm&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;>
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>
ru.tander.bpm.userapi.domain.definition.ProcDefinitionVersion
</class>
<properties>
<property name=&quot;hibernate.dialect&quot;
value=&quot;org.hibernate.dialect.H2Dialect&quot;/>
<property name=&quot;hibernate.hbm2ddl.auto&quot; value=&quot;validate&quot;/>
<property name=&quot;javax.persistence.jdbc.driver&quot;
value=&quot;org.h2.Driver&quot;/>
<property name=&quot;javax.persistence.jdbc.url&quot;
value=&quot;jdbc:h2:tcp://localhost/~/bpm-persistance&quot;/>
<property name=&quot;javax.persistence.jdbc.user&quot; value=&quot;admin&quot;/>
<property name=&quot;javax.persistence.jdbc.password&quot; value=&quot;admin&quot;/>
<property name=&quot;auto-commit&quot; value=&quot;true&quot;/>
</properties>
</persistence-unit>
</persistence>
[/code]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment