title: Is it possible to use Java Configuration rather than persistence.xml for Hibernate OGM Persistence setup?
body: <p>So far in all the documentations of Hibernate OGM I have never seen any example of setup using Spring's Java @Configuration. All the examples in the documentation and example projects use persistence.xml to configure the persistence-unit.</p>
  
  <p>Is there any reason/limitation why Java config can't be used to achieve Hibernate OGM Persistence setup ?</p>
  
  <p>Ideally I would like to convert the below persistence.xml into a java config:</p>
  
  <p></p>
  
  <pre><code>    &lt;!-- Use the Hibernate OGM provider: configuration will be transparent --&gt;
      &lt;provider&gt;org.hibernate.ogm.jpa.HibernateOgmPersistence&lt;/provider&gt;
      &lt;properties&gt;
          &lt;!-- Here you will pick which NoSQL technology to use, and configure it;
               in this example we start a local in-memory redis_experimental node. --&gt;
          &lt;property name="hibernate.ogm.datastore.provider" value="redis_experimental"/&gt;
          &lt;property name="hibernate.ogm.datastore.host" value="127.0.0.1:6379"/&gt;
          &lt;property name="hibernate.cache.use_second_level_cache" value="true"/&gt;
          &lt;property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.redis.hibernate5.SingletonRedisRegionFactory"/&gt;
          &lt;property name="hibernate.cache.region_prefix" value="hibernate"/&gt;
          &lt;property name="hibernate.cache.use_query_cache" value="true"/&gt;
          &lt;property name="hibernate.cache.provider_configuration_file_resource_path" value="hibernate-redis.properties"/&gt;
  
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>