Docs Menu
Docs Home
/ /

Hibernate ORM Feature Compatibility

On this page, you can find information about supported and unsupported features in the Hibernate ORM extension. The Hibernate ORM extension supports only MongoDB replica sets. When you use an unsupported feature, the Hibernate ORM extension throws an UnsupportedFeatureException.

You can also find features currently planned for future releases on this page. We will prioritize these upcoming features based on user demand, and you can request support for a feature by creating an AHA idea.

MongoDB Extension for Hibernate ORM is currently in Public Preview. Public Preview is not recommended for production deployments, because breaking changes might be introduced.

This section indicates whether the Hibernate ORM extension supports various MongoDB features.

To see a list of all BSON types supported in the Hibernate ORM extension, see the MongoDB BSON Fields section in the Create Entities guide.

MongoDB Feature
Public Preview Support
General Availability (GA) Support

Bulk Writes

Delete operations

Geospatial queries

Unsupported. However, the createNativeQuery() method supports geospatial queries. Include the $geoWithin or $near pipeline stage in your MongoDB Query Language statement. To learn more about native queries, see the Perform Native Database Queries guide.

We are considering this feature for GA release.

Insert operations

MongoDB Search queries

Unsupported. However, the createNativeQuery() method supports Search queries. Include the $search pipeline stage in your MongoDB Query Language statement. To view an example, see the Run a MongoDB Search Query section in the Perform Native Database Queries guide.

We are considering this feature for GA release.

MongoDB Vector Search queries

Unsupported. However, the createNativeQuery() method supports Vector Search queries. Include the $vectorSearch pipeline stage in your MongoDB Query Language statement. To learn more about native queries, see the Perform Native Database Queries guide.

We are considering this feature for GA release.

Native Querying with MQL

Partially Supported. Parameter binding is not supported.

Projections

Partially Supported. Aggregation expressions within query projections are not supported, and you must include all entity fields in your projection.
Partially Supported. The same aggregation expression and entity field limitations apply.

Read operations

Update operations

Upsert operations

Unsupported. However, you can first query the collection to check if the specified value exists, and then insert or update if the value exists.

We are considering this feature for GA release.

MongoDB Feature
Public Preview Support
General Availability (GA) Support

Change Streams

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, use the MongoClient.watch() method to open a change stream.

We are considering this feature for GA release.

Client-side Field Level Encryption (CSFLE) and Queryable Encryption (QE)

Unsupported. However, you can setup CSFLE/QE when you configure the MongoDB Java Driver.

We are considering this feature for GA release.

GridFS

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the GridFSBuckets.create() method with a MongoDatabase instance as the parameter to instantiate a GridFSBucket.

We are considering this feature for GA release.

Timeseries data

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, create a new collection with timeSeriesOptions() specified to create a time series collection.

We are considering this feature for GA release.

Views

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the createView() method on your MongoDatabase instance to create a new view.

We are considering this feature for GA release.

MongoDB Feature
Public Preview Support
General Availability (GA) Support

Locking

Partially Supported. Optimistic locking is supported.

We are considering this feature for GA release.

Transactions

MongoDB Feature
Public Preview Support
General Availability (GA) Support

Associations

Unsupported.

Autogenerating IDs

Partially Supported. Autogenerating ObjectIds is supported. However, you can manually set an UUID.

We are considering this feature for GA release.

Inheritance Strategy

Unsupported.

Lazy/Eager Fetching

Unsupported.

Unsupported.

Ordering

Validation

MongoDB Feature
Public Preview Support
General Availability (GA) Support

Capped Collections

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, create a capped collection by specifying CreateCollectionOptions.capped(true) as a parameter in your createCollection() call.

We are considering this feature for GA release.

Clustered Collections

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, create a document called clusteredIndex and define your clustered index. Use this clustered index as a part of the document you pass to the MongoDatabase.runCommand() method, which defines the clustered collection.

We are considering this feature for GA release.

Compound indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the nested method MongoCollection.createIndex(Indexes.compoundIndex()) to create a compound index.

We are considering this feature for GA release.

Embedded document indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the nested method MongoCollection.createIndex(Indexes.ascending("field.subfield")). This method uses nested key paths "field.subfield" to create an embedded document index.

We are considering this feature for GA release.

Geospatial indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the nested method MongoCollection.createIndex(geo2dsphere("location")) to create a geospatial index on the location field.

We are considering this feature for GA release.

MongoDB Search indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the MongoCollection.createSearchIndex() method to create a MongoDB Search index.

We are considering this feature for GA release.

MongoDB Vector Search indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the MongoCollection.createSearchIndexes() method with a vector type SearchIndexModel to create a MongoDB Vector Search index.

We are considering this feature for GA release.

Multikey indexes

Unsupported. Use the default MongoDB behavior for array fields.

We are considering this feature for GA release.

Partial indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the nested method MongoCollection.createIndex(Indexes.partialFilterExpression()) to create a partial index.

We are considering this feature for GA release.

Schema Validation

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, create a validator by executing the collMod command through the MongoDatabase.runCommand() method.

We are considering this feature for GA release.

Single field indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, call the nested method MongoCollection.createIndex(Indexes.ascending("field")) to create a single field index in ascending order on the field field.

We are considering this feature for GA release.

Sparse indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, specify IndexOptions().sparse(true) as a parameter in your call to the MongoCollection.createIndex() method to create a sparse index.

We are considering this feature for GA release.

Unique indexes

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, specify IndexOptions().unique(true) as a parameter in your call to the MongoCollection.createIndex() method to create a sparse index.

We are considering this feature for GA release.

Updating embedded model indexes after model creation

Unsupported. However, you can drop and recreate the embedded model index manually.

We are considering this feature for GA release.

This section indicates whether the Hibernate ORM extension supports various Hibernate ORM Features.

Data Type
Public Preview Support
General Availability (GA) Support

Collection Types (List, Set, Maps, Arrays)

✓. @ElementCollection and CollectionTable are not supported. However, collections of embedded structs are supported through embeddable classes annotated with @Embeddable and @Struct.
✓. The same @ElementCollection and CollectionTable limitations apply.

Embeddable Entities, Scalar Types

Partially Supported. The java.time.Instant type is supported for top-level and nested entities.
Partially Supported. The java.time.Instant type is supported for top-level and nested entities.

Embedded Entities, Binary

Embedded Entities, Identifier Types

Partially Supported. Manually set the ID of an entity before persisting an entity.
We are considering this feature for GA release.

Embedded Entities, JSON

Embedded Entities, Null Sematics

Top-level Entities, Binary

Top-level Entities, Identifier Types

Manually assign UUIDs before persisting an entity.
Manually assign UUIDs before persisting an entity.

Top-level Entities, JSON

Top-level Entities, Null Sematics

Top-level Entities, Scalar Types

Top-level Entities, Temporal Types

Partially Supported. The java.time.Instant type is supported for top-level and nested entities.
Partially Supported. The java.time.Instant type is supported for top-level and nested entities.

Ternary Logic (True, False, or UNKNOWN)

Unsupported.

Planned.

Hibernate ORM Feature
Public Preview Support
General Availability (GA) Support

HQL and JPQL Queries, Aggregate Operators

Unsupported. However, the createNativeQuery() method supports aggregate operators. Include the operator in your MongoDB Query Language statement. To learn more about native queries, see the Perform Native Database Queries guide.

Planned.

HQL and JPQL Queries, Arithmetic Operators

Unsupported. However, the createNativeQuery() method supports arithmetic operators. To view an example, see the Use Arithmetic Operators section in the Perform Native Database Queries guide.

We are considering this feature for GA release.

HQL and JPQL Queries, Array Operators

HQL and JPQL Queries, Comparison Operators

Partially Supported. The operators LIKE, BETWEEN, IN, EXISTS, ANY, ALL, and IS NULL are not currently supported. However, you can use the createNativeQuery() method and pass comparison operators in your MongoDB Query Language statement. To learn more about native queries, see the Perform Native Database Queries guide.
Planned.

HQL and JPQL Queries, Element Operators

HQL and JPQL Queries, Evaluation Operators

Unsupported. However, the createNativeQuery() method supports evaluation operators. Include the operator in your MongoDB Query Language statement. To learn more about native queries, see the Perform Native Database Queries guide.

Planned.

HQL and JPQL Queries, JOINS

Unsupported. However, you can use the MongoDB Java Driver to define a MongoClient instance. Then, you can query on multiple collections by using an aggregation pipeline.

Planned.

HQL and JPQL Queries, Logical Operators

Hibernate ORM Feature
Public Preview Support
General Availability (GA) Support

First-Level Cache

Second-Level Cache

This section indicates whether the Hibernate ORM extension supports various external frameworks or libraries.

Framework or Library
Public Preview Support
General Availability (GA) Support

Spring Boot and Spring Data

Partially Supported. We do not guarantee support for all Spring Boot or Spring Data features. See the Spring Data with MongoDB Hibernate App for an example of an app made with the Hibernate ORM extension and Spring Data.

Partially Supported. We do not guarantee support for all Spring Boot or Spring Data features. See the Spring Data with MongoDB Hibernate App for an example of an app made with the Hibernate ORM extension and Spring Data.

Back

Transactions

On this page