Hibernate OGM for MongoDB

Persist objects in MongoDB

License

License

Categories

Categories

MongoDB Data Databases Hibernate ORM
GroupId

GroupId

org.hibernate.ogm
ArtifactId

ArtifactId

hibernate-ogm-mongodb
Last Version

Last Version

5.4.1.Final
Release Date

Release Date

Type

Type

jar
Description

Description

Hibernate OGM for MongoDB
Persist objects in MongoDB
Project URL

Project URL

http://ogm.hibernate.org/hibernate-ogm-mongodb
Project Organization

Project Organization

Hibernate

Download hibernate-ogm-mongodb

How to add to project

<!-- https://jarcasting.com/artifacts/org.hibernate.ogm/hibernate-ogm-mongodb/ -->
<dependency>
    <groupId>org.hibernate.ogm</groupId>
    <artifactId>hibernate-ogm-mongodb</artifactId>
    <version>5.4.1.Final</version>
</dependency>
// https://jarcasting.com/artifacts/org.hibernate.ogm/hibernate-ogm-mongodb/
implementation 'org.hibernate.ogm:hibernate-ogm-mongodb:5.4.1.Final'
// https://jarcasting.com/artifacts/org.hibernate.ogm/hibernate-ogm-mongodb/
implementation ("org.hibernate.ogm:hibernate-ogm-mongodb:5.4.1.Final")
'org.hibernate.ogm:hibernate-ogm-mongodb:jar:5.4.1.Final'
<dependency org="org.hibernate.ogm" name="hibernate-ogm-mongodb" rev="5.4.1.Final">
  <artifact name="hibernate-ogm-mongodb" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.hibernate.ogm', module='hibernate-ogm-mongodb', version='5.4.1.Final')
)
libraryDependencies += "org.hibernate.ogm" % "hibernate-ogm-mongodb" % "5.4.1.Final"
[org.hibernate.ogm/hibernate-ogm-mongodb "5.4.1.Final"]

Dependencies

compile (5)

Group / Artifact Type Version
org.hibernate.ogm : hibernate-ogm-core jar 5.4.1.Final
org.hibernate.common : hibernate-commons-annotations jar 5.0.3.Final
org.hibernate.hql : hibernate-hql-parser jar 1.5.0.Final
org.mongodb : mongo-java-driver jar 3.9.1
org.parboiled : parboiled-java jar 1.1.8

provided (2)

Group / Artifact Type Version
org.jboss.logging : jboss-logging-processor jar 2.1.0.Final
org.jboss.spec.javax.transaction : jboss-transaction-api_1.2_spec jar 1.0.1.Final

test (13)

Group / Artifact Type Version
junit : junit jar 4.12
org.hibernate : hibernate-search-orm jar 5.10.4.Final
org.hibernate.ogm : hibernate-ogm-core test-jar 5.4.1.Final
log4j : log4j jar 1.2.16
org.easytesting : fest-assert jar 1.4
org.jboss.shrinkwrap : shrinkwrap-impl-base jar
org.mockito : mockito-core jar 1.9.5
com.google.guava : guava jar 18.0
io.takari.junit : takari-cpsuite jar 1.2.7
org.skyscreamer : jsonassert jar 1.2.3
org.jboss.byteman : byteman jar 4.0.2
org.jboss.byteman : byteman-bmunit jar 4.0.2
org.jboss.byteman : byteman-install jar 4.0.2

Project Modules

There are no modules declared in this project.

Hibernate OGM

Version: 5.4.1.Final - 18-12-2018

Description

Hibernate OGM stores data in a NoSQL data grid using the Hibernate ORM engine.

The benefits are fairly obvious:

  • write your model once using well known JPA annotations and select the right NoSQL data grid for your project
  • Hibernate is familiar to many people
  • you end up being able to use all the tools of the Hibernate ecosystem such as Hibernate Search or Hibernate Validator

Checkout http://hibernate.org/ogm/ for more information.

Core datastores and contrib datastores

Hibernate OGM supports a large number of NoSQL datastores.

Some are included in this very repository:

  • Infinispan
  • MongoDB
  • Neo4j

Others are in separate repositories, called contrib:

Useful pointers

Latest Documentation:

Bug Reports:

Support:

Build instructions

The code is available on GitHub at https://github.com/hibernate/hibernate-ogm.

To run the full project build including tests for all backends, documentation etc. execute:

mvn clean install -s settings-example.xml

Note that for running the test suite against separately installed MongoDB or Neo4j servers their host name must be specified via an environment variable. See the sections below for the details.

To speed things up, there are several options for skipping parts of the build. To run the minimum project build without integration tests, documentation and distribution execute:

mvn clean install -DskipITs -DskipDocs -DskipDistro -s settings-example.xml

The following sections describe these options in more detail.

Importing sources in Eclipse

Import the project as any standard Maven project. This might trigger a dialog to automatically find and install additional m2e plugins: allow that.

Make sure that annotation processing is enabled in your project settings (see "Properties" - "Maven" - "Annotation Processing", the setting should be "Automatically configure JDT APT").

Integration tests

You can skip integration tests by specifying the skipITs property:

mvn clean install -DskipITs -s settings-example.xml

Documentation

The documentation is built by default as part of the project build. You can skip it by specifying the skipDocs property:

mvn clean install -DskipDocs -s settings-example.xml

If you just want to build the documentation, run it from the documentation/manual subdirectory.

By default, the following command only builds the HTML version of the documentation:

mvn clean install -f documentation/manual/pom.xml -s settings-example.xml

If you also wish to generate the PDF version of the documentation, you need to use the documentation-pdf profile:

mvn clean install -f documentation/manual/pom.xml -s settings-example.xml -Pdocumentation-pdf

Distribution

The distribution bundle is built by default as part of the project build. You can skip it by specifying the skipDistro property:

mvn clean install -DskipDistro -s settings-example.xml

Integration tests

Integration tests can be run from the integrationtest module and the default behaviour is to download the WildFly application server, unpack the modules in it and run the tests using Arquillian.

WARNING

Be careful when using on existing installation since the modules used by the build are going to be extracted into the server you want to run the test, changing the original setup.

MongoDB

For executing the tests in the mongodb and integrationtest/mongodb modules, by default the embedmongo-maven-plugin is used which downloads the MongoDB distribution, extracts it, starts a mongod process and shuts it down after test execution.

If required, you can configure the port to which the MongoDB instance binds to (by default 27018) and the target directory for the extracted binary (defaults to ${project.build.directory}/embeddedMongoDb/extracted) like this:

mvn clean install -s settings-example.xml -DembeddedMongoDbTempDir=<my-temp-dir> -DembeddedMongoDbPort=<my-port>

To work with a separately installed MongoDB instance instead, specify the property -DuseExternalMongoDb:

mvn clean install -s settings-example.xml -DuseExternalMongoDb

This assumes MongoDB to be installed on localhost, using the default port and no authentication. If you work with different settings, configure the required properties in hibernate.properties (for the tests in mongodb) and/or the environment variables MONGODB_HOSTNAME MONGODB_PORT MONGODB_USERNAME MONGODB_PASSWORD (for the tests in integrationtest/mongodb) prior to running the tests:

export MONGODB_HOSTNAME=mongodb-machine
export MONGODB_PORT=1234
export MONGODB_USERNAME=someUsername
export MONGODB_PASSWORD=someP@ssw0rd
mvn clean install -s settings-example.xml -DuseExternalMongoDb

Neo4j

For running the tests in the neo4j and integrationtest/neo4j modules, by default the embedded Neo4j configuration is used.

Hibernate OGM can connect to a Neo4j server remotely via the Bolt protocol or via HTTP. These tests are not executed by default, you can run them using the following commands:

mvn clean install -s settings-example.xml -Pneo4j-http

or

mvn clean install -s settings-example.xml -Pneo4j-bolt

This assumes Neo4j to be installed on localhost, using the default port and no authentication. If you work with different settings, configure the required properties in hibernate.properties and/or the environment variables NEO4J_HOSTNAME, NEO4J_PORT, NEO4J_USERNAME and NEO4J_PASSWORD prior to running the tests:

export NEO4J_HOSTNAME=neo4j-machine
export NEO4J_PORT=1234
export NEO4J_USERNAME=someUsername
export NEO4J_PASSWORD=someP@ssw0rd

Notes

If you want to contribute, come to the [email protected] mailing list or join us on #hibernate-dev on freenode (login required)

This software and its documentation are distributed under the terms of the FSF Lesser Gnu Public License (see license.txt).

org.hibernate.ogm

Hibernate

Versions

Version
5.4.1.Final
5.4.0.Final
5.4.0.CR1
5.4.0.Beta2
5.4.0.Beta1
5.4.0.Alpha1
5.3.1.Final
5.3.0.Final
5.3.0.CR1
5.2.0.Final
5.2.0.CR1
5.2.0.Beta1
5.2.0.Alpha1
5.1.0.Final
5.1.0.CR1
5.1.0.Beta3
5.1.0.Beta2
5.1.0.Beta1
5.1.0.Alpha1
5.0.4.Final
5.0.3.Final
5.0.2.Final
5.0.1.Final
5.0.0.Final
5.0.0.CR1
5.0.0.Beta1
5.0.0.Alpha1
4.2.0.Final
4.2.0.CR1
4.2.0.Beta1
4.1.3.Final
4.1.2.Final
4.1.1.Final
4.1.0.Final
4.1.0.CR1
4.1.0.Beta8
4.1.0.Beta7
4.1.0.Beta6
4.1.0.Beta5
4.1.0.Beta4
4.1.0.Beta3
4.1.0.Beta2
4.1.0.Beta1
4.0.0.Beta4
4.0.0.Beta3
4.0.0.Beta1