This product enables applications to use databases managed by the MongoDB DBMS via Hibernate ORM.
MongoDB speaks MQL (MongoDB Query Language) instead of SQL. This product works by:
- Creating a JDBC adapter using MongoDB Java Driver,
which has to be plugged into Hibernate ORM via a custom
ConnectionProvider. - Translating Hibernate's internal SQL AST into MQL by means of a custom
Dialect, which has to be plugged into Hibernate ORM.
Standalone deployments are not supported, because they do not support transactions. If you use one, you may convert it to a replica set.
The groupId:artifactId coordinates: org.mongodb:mongodb-hibernate.
Use "Extension for Hibernate ORM" at jira.mongodb.org.
Use "Drivers & Frameworks"/"Frameworks (e.g. Django, Hibernate, EFCore)" at feedback.mongodb.com.
Gradle is used as a build tool.
./gradlew clean buildSpotless Gradle plugin is used as a general-purpose formatting tool, Palantir Java Format is used as a Java-specific formatting tool integrated with it.
./gradlew spotlessCheck./gradlew spotlessApplyError Prone Gradle plugin
is used as a Java-specific code analysis tool,
NullAway is used as a
NullPointerException
prevention tool integrated with it. JSpecify annotations are used to specify nullness.
The analysis is done as part of the Gradle compileJava task execution.
This project uses separate directories for unit and integration tests:
Integration tests require a MongoDB deployment with test commands enabled, which may be achieved with the
--setParameter enableTestCommands=1
command-line arguments.
You may change the MongoDB connection string
via the jakarta.persistence.jdbc.url
configuration property
in ./src/integrationTest/resources/hibernate.properties.
./gradlew test./gradlew integrationTestEvergreen and GitHub actions are used for continuous integration.