Skip to content

mongodb/mongo-hibernate

Repository files navigation

MongoDB Extension for Hibernate ORM

Java SE requirement Hibernate ORM requirement MongoDB DBMS requirement

Overview

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.

User Documentation

Standalone deployments are not supported, because they do not support transactions. If you use one, you may convert it to a replica set.

Maven Artifacts

The groupId:artifactId coordinates: org.mongodb:mongodb-hibernate.

Bug Reports

Use "Extension for Hibernate ORM" at jira.mongodb.org.

Feature Requests

Use "Drivers & Frameworks"/"Frameworks (e.g. Django, Hibernate, EFCore)" at feedback.mongodb.com.

Contributor Documentation

Gradle is used as a build tool.

Build from Source

./gradlew clean build

Static Code Analysis

Code Formatting

Spotless Gradle plugin is used as a general-purpose formatting tool, Palantir Java Format is used as a Java-specific formatting tool integrated with it.

Check Code Formatting
./gradlew spotlessCheck
Format Code
./gradlew spotlessApply

Code Quality

Error 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.

Testing

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.

Run Unit Tests

./gradlew test

Run Integration Tests

./gradlew integrationTest

Continuous Integration

Evergreen and GitHub actions are used for continuous integration.

About

An extension providing MongoDB support to Hibernate ORM

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7