-
Type:
New Feature
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Configuration
-
None
-
5
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Goal
Let a Spring Boot 4.x application use MongoDB-backed JPA (via the MongoDB Extension for Hibernate ORM)
with minimal, idiomatic configuration — a plain @SpringBootApplication, no knowledge of Hibernate,
JPA, or Spring Boot internals, and no manual bean wiring.
Requirements
- Activate and connect through standard Spring configuration (Spring's MongoDB connection setup plus the
standard spring.jpa.* properties), not bespoke properties or custom annotations. - Reuse the application's single MongoClient / connection pool — never open a second pool to the same
cluster when the application also uses Spring's MongoDB support, and never take over the client's
lifecycle. - Honor the full spring.jpa.* surface (ddl-auto, show-sql, naming strategies, Hibernate/EMF
customizer beans), as in any Spring Boot JPA application. - Provide Spring Data JPA repository support without requiring a SQL DataSource.
- Stay completely inert when MongoDB-JPA is not intended — e.g. a SQL-JPA application that merely has the
module on its classpath, or a Spring Data MongoDB application that has a MongoClient but no Hibernate
JPA — with no interference to a SQL persistence unit. - Default field naming so documents are not silently reshaped relative to plain Hibernate (no surprise
camelCase → snake_case on a schemaless store); allow an explicit override. - Fail fast with an actionable message when activated but misconfigured (e.g. no MongoClient available, or
no database name resolvable). - Offer an escape hatch for advanced cases (a dedicated client, multiple persistence units) without
fighting the auto-configuration.
Compatibility
Spring Boot 4.x; Hibernate ORM 7.3 or later. (Spring Boot's dependency management may force an older
Hibernate from its BOM; until a Boot release ships 7.3+, the application overrides the managed version.)
- is related to
-
HIBERNATE-137 Feature: Improved Spring Data/Boot Integration
-
- Closed
-
There are no Sub-Tasks for this issue.