MongoDBAnnouncement
MongoDB Extension for Hibernate ORM is Now GA
Summary
The MongoDB Extension for Hibernate ORM is now generally available as a first-party, open-source library, giving Java teams a production-ready way to use familiar Hibernate APIs with MongoDB’s document model. Developers can continue using @Entity annotations, HQL, Criteria Queries, and Session APIs while building new applications or migrating existing Hibernate workloads from relational databases. The GA release adds JOIN support (INNER and LEFT OUTER) via standard HQL/JPQL syntax, optimistic locking with @Version, Spring Boot auto-configuration that auto-detects dialect and connection provider from the MongoDB JDBC URL, and clearer exception messaging and logging. The extension transparently translates Hibernate operations into MongoDB aggregation pipelines and requires Hibernate ORM 7.4 LTS. It also supports native embedded documents for faster reads and allows dropping into MongoDB’s native Query API for advanced operations like vector search and geospatial queries.
Context
Java developers using Hibernate with relational databases face constraints like difficulty evolving schemas and handling diverse data types. The MongoDB Extension for Hibernate ORM aims to provide the familiar Hibernate experience while leveraging MongoDB’s flexible document model, allowing schema evolution and easier handling of various data types. It is now GA with key features like JOIN support, optimistic locking, Spring Boot auto-configuration, and improved logging.
Approach / What changed
The MongoDB Extension for Hibernate ORM is a first-party, open-source library that maps Java entities to MongoDB collections and translates Hibernate operations (persist, find, HQL queries) into MongoDB commands via a custom dialect. It supports JOINs, optimistic locking, Spring Boot auto-configuration, and allows using both HQL/JPQL and MongoDB’s native Query API.
Takeaways
The extension supports JOINs (INNER and LEFT OUTER) across MongoDB collections using standard HQL/JPQL syntax, eliminating manual lookups.
It provides optimistic locking via @Version annotation for concurrency control, preventing conflicting updates to the same entity.
The extension requires Hibernate ORM 7.4 LTS and is designed for production use, but does not aim for full HQL coverage; some SQL constructs do not map to MongoDB’s document model.
FAQ
Does the extension support all HQL queries?
No, the extension covers the most common Hibernate patterns but does not aim for full HQL coverage; some SQL constructs do not map to MongoDB's document model, and that is by design.
What are the requirements to use the extension?
The extension requires an upgrade to Hibernate ORM 7.4 LTS. It is a first-party open-source library that can be added to a project's build setup.
Source and freshness
- Source
- mongodb.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.