Hibernate.orgCommunity Documentation

Chapter 8. NoSQL datastores

8.1. Using a specific NoSQL datastore

Currently Hibernate OGM supports the following NoSQL datastores:

More are planned, if you are interested, come talk to us (see Chapter 1, How to get help and contribute on Hibernate OGM).

For each datastore, Hibernate OGM has specific integration code called a datastore provider. All are in a dedicated maven module, you simply need to depend on the one you use.

Hibernate OGM interacts with NoSQL datastores via two contracts:

Only a few steps are necessary:

Adding the relevant Hibernate OGM module in your classpath looks like this in Maven:


The module names are hibernate-ogm-infinispan, hibernate-ogm-ehcache, hibernate-ogm-mongodb, hibernate-ogm-neo4j and hibernate-ogm-couchdb. The map datastore is included in the Hibernate OGM engine module.

Next, configure which datastore provider you want to use. This is done via the hibernate.ogm.datastore.provider option. Possible values are:

By default, a datastore provider chooses the best grid dialect transparently but you can manually override that setting with the hibernate.ogm.datastore.grid_dialect option. Use the fully qualified class name of the GridDialect implementation. Most users should ignore this setting entirely and live a happier life instead.

Let’s now look at the specifics of each datastore provider. How to configure it further, what mapping structure is used and more.