public
Created

Hibernate OGM configuration before / after

  • Download Gist
persistence.xml
Liquid
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<!-- when using a relational database -->
<persistence ...>
<persistence-unit name="users" transaction-type="RESOURCE_LOCAL">
<properties>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
<property name="javax.persistence.jdbc.user" value="sa"/>
<property name="javax.persistence.jdbc.password" value=""/>
<property name="javax.persistence.jdbc.url" value="jdbc:h2:tcp://localhost/./intro-ogm"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.max_fetch_depth" value="3"/>
</properties>
</persistence-unit>
</persistence>
 
<!-- when using Hibernate OGM -->
<persistence ...>
<persistence-unit name="users" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<properties>
<property name="hibernate.ogm.infinispan.configuration_resourcename"
value="META-INF/ispn-config.xml"/>
</properties>
</persistence-unit>
</persistence>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.