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.
Is there any reason/limitation why Java config can't be used to achieve Hibernate OGM Persistence setup ?
Ideally I would like to convert the below persistence.xml into a java config:
<!-- Use the Hibernate OGM provider: configuration will be transparent -->
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<properties>
<!-- Here you will pick which NoSQL technology to use, and configure it;
in this example we start a local in-memory redis_experimental node. -->
<property name="hibernate.ogm.datastore.provider" value="redis_experimental"/>
<property name="hibernate.ogm.datastore.host" value="127.0.0.1:6379"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.redis.hibernate5.SingletonRedisRegionFactory"/>
<property name="hibernate.cache.region_prefix" value="hibernate"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.provider_configuration_file_resource_path" value="hibernate-redis.properties"/>
</properties>
</persistence-unit>