Quarkus Morphium Extension
The Quarkus Morphium extension integrates Morphium, an actively maintained MongoDB ORM for Java, into Quarkus via CDI — with full Jakarta Data 1.0 support.
Jakarta Data 1.0 — Declarative Repositories for MongoDB
Define a @Repository interface, inject it, done. The implementation is generated at build time
via Gizmo bytecode generation — no runtime reflection, no proxies, GraalVM native-image compatible.
@Repository
public interface ProductRepository extends MorphiumRepository<Product, MorphiumId> {
List<Product> findByCategory(String category);
@OrderBy("price")
List<Product> findByPriceBetween(double min, double max);
}
Supports: query derivation (findBy, countBy, existsBy, deleteBy), @Find/@By,
@Query with JDQL, @OrderBy, pagination (Page, PageRequest), sorting (Sort, Order),
and auto-generated @StaticMetamodel classes.
All Morphium ORM features (@Version, @CreationTime, @PreStore, @Cache, @Reference)
work transparently through repositories.
For the full guide see Jakarta Data 1.0.
Features
-
Jakarta Data 1.0 –
@Repositoryinterfaces with query derivation,@Find/@By,@Query/JDQL, pagination,@StaticMetamodel -
MorphiumRepository – provider-specific extension with
distinct(),morphium(),query()escape hatch -
Zero-boilerplate injection – inject
Morphiumor any@Repositoryinterface directly via@Inject -
Declarative transactions –
@MorphiumTransactionalfor automatic commit / rollback with CDI lifecycle events -
Type-safe configuration – all settings live under the
quarkus.morphium.*prefix inapplication.properties -
Dev Services – a MongoDB container is started automatically in dev and test mode; no manual Docker setup needed
-
Health checks – MicroProfile liveness, readiness, and startup probes registered automatically
-
SSL/TLS & X.509 – encrypted connections and client-certificate authentication
-
GraalVM native ready – all
@Entityand@Embeddedclasses are registered for reflection at build time -
Blocking call detection – warns when Morphium writes are called from the Vert.x event loop
-
Dev UI card – shows MongoDB connection info in the Quarkus Dev UI at
/q/dev-ui/ -
Fast tests – use the
InMemDriverprofile fromquarkus-morphium-testingfor instant, container-free tests
Documentation
Installation, minimal configuration, first entity, first query. |
|
|
|
All |
|
|
|
Declarative |
|
Automatic MongoDB container, replica-set mode, Dev UI card, hot-reload behavior. |
|
MicroProfile liveness, readiness, and startup probes with pool metadata. |
|
Dev Services vs. InMemDriver strategies, test isolation, mixing approaches. |
|
SSL/TLS, Atlas SRV, blocking call detector, GraalVM native image details. |
Links
-
Morphium on GitHub — the core ODM library
-
Morphium Documentation — full API reference, messaging, aggregation
-
quarkus-morphium on GitHub — this extension’s source code
-
quarkus-morphium-showcase — demo application showing all features