Overview
在此页面上,您可以找到有关 Hibernate ORM 扩展支持和不支持的功能的信息。Hibernate ORM 扩展仅支持MongoDB副本集。当您使用不支持的功能时,Hibernate ORM 扩展会引发 UnsupportedFeatureException。
You can request support for a feature by creating an AHA idea. We prioritize upcoming features based on user demand.
MongoDB功能
本部分指示 Hibernate ORM 扩展是否支持各种 MongoDB 功能。
数据类型支持
要查看 Hibernate ORM 扩展支持的所有 BSON types 的列表,请参阅创建实体指南中的 MongoDB BSON Fields 部分。
查询支持
MongoDB功能 | 正式可用性 (GA) 支持 |
|---|---|
批量写入 | ✓ |
删除操作 | ✓ |
地理空间查询 | 不支持。但是, |
插入操作 | ✓ |
MongoDB Search 查询 | 不支持。但是, |
MongoDB Vector Search 查询 | 不支持。但是, |
使用 MQL 进行原生查询 | ✓ |
投影 | Partially Supported. Aggregation expressions within query projections are not supported, and you must include all entity fields in your projection. |
读取操作 | ✓ |
更新操作 | ✓ |
更新或插入操作 | 部分支持。通过 |
数据库和集合支持
MongoDB功能 | 正式可用性 (GA) 支持 |
|---|---|
Change Streams | Unsupported. However, you can use a change stream through the MongoDB Java Driver. To learn more, see the Open Change Streams section in the Java Driver documentation. |
客户端字段级加密(CSFLE) 和Queryable Encryption(QE) | Unsupported. We are considering this feature for future release. However, you can setup CSFLE/QE when you configure the MongoDB Java Driver. To learn more, see the CSFLE documentation in the MongoDB Server manual. |
GridFS | Unsupported. However, you can use GridFS through the MongoDB Java Driver. To learn more, see the Large File Storage with GridFS guide in the Java Driver documentation. |
时间序列数据 | Unsupported. However, you can create a time series collection through the MongoDB Java Driver. To learn more, see the Time Series Collections guide in the Java Driver documentation. |
独立运行的实例 | 不受支持。我们建议您将所有独立运行的实例转换为副本集。要了解更多信息,请参阅MongoDB Server手册中的将独立运行的自管理mongod转换为副本集。 |
视图 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 |
事务和并发
MongoDB功能 | 正式可用性 (GA) 支持 |
|---|---|
锁定 | 部分支持。具有使用 |
事务 | ✓ |
映射和模型支持
MongoDB功能 | 正式可用性 (GA) 支持 |
|---|---|
关联 | 部分支持。 |
自动生成 ID | 部分支持。支持自动生成 ObjectId。但是,您可以手动设置 |
复合主键 | 部分支持。在标准 |
继承策略 | 部分支持。支持单表继承和映射超类。不支持 |
| 不支持。 |
延迟/预先获取 | 不支持。 |
排序 | ✓ |
| 不支持。Hibernate ORM 扩展在启动时拒绝 |
| ✓ |
验证 | ✓ |
索引支持
MongoDB功能 | 正式可用性 (GA) 支持 |
|---|---|
固定大小集合 | 不支持。但是,您可以使用 MongoDB Java 驱动程序来定义 |
集群化集合 | 不支持。但是,您可以使用 MongoDB Java 驱动程序来定义 |
复合索引 | ✓ |
嵌入式文档索引 | 不支持。但是,您可以使用 MongoDB Java 驱动程序来定义 |
地理空间索引 | Unsupported. However, you can use geospatial indexes through the MongoDB Java Driver. To learn more, see the Geospatial Indexes section of the Indexes guide in the Java Driver documentation. |
MongoDB搜索索引 | Unsupported. However, you can use MongoDB Search indexes through the MongoDB Java Driver. To learn more, see the MongoDB Search and Vector Search Indexes section of the Indexes guide in the Java Driver documentation. |
MongoDB Vector Search 索引 | Unsupported. However, you can use MongoDB Vector Search indexes through the MongoDB Java Driver. To learn more, see the MongoDB Search and Vector Search Indexes section of the Indexes guide in the Java Driver documentation. |
Multikey Indexes | Unsupported. However, you can use multikey indexes through the MongoDB Java Driver. To learn more, see the Multikey Indexes (Indexes on Array Fields) section of the Indexes guide in the Java Driver documentation. |
部分索引 | 不支持。但是,您可以使用 MongoDB Java 驱动程序来定义 |
模式验证 | 不支持。但是,您可以使用 MongoDB Java 驱动程序来定义 |
单字段索引 | ✓ |
Sparse Indexes | 不支持。但是,您可以使用 MongoDB Java 驱动程序来定义 |
Unique Indexes | ✓ |
在创建模型后更新嵌入式模型索引 | 不支持。但是,您可以手动删除并重新创建嵌入式模型索引。 |
要了解有关索引的更多信息,请参阅索引以进行查询优化指南。
Hibernate ORM 功能
本部分指示 Hibernate ORM 扩展是否支持各种 Hibernate ORM 功能。
数据类型支持
数据类型 | 正式可用性 (GA) 支持 |
|---|---|
集合类型(列表、集、映射、数组) | ✓ |
可嵌入式实体、标量类型 | 部分支持。 |
嵌入式实体,二进制 | ✓ |
嵌入式实体、标识符类型 | 部分支持。在实体持久化之前,手动设置实体的 ID。 |
嵌入式实体, JSON | ✓ |
嵌入式实体、空语义 | ✓ |
顶级实体,二进制 | ✓ |
顶级实体、标识符类型 | ✓ |
顶级实体, JSON | ✓ |
顶级实体,空语义 | ✓ |
顶级实体、标量类型 | ✓ |
顶级实体、时态类型 | 部分支持。 |
三元逻辑(True、False 或 UNKNOWN) | 不支持。 |
查询支持
Hibernate ORM 功能 | 正式可用性 (GA) 支持 |
|---|---|
HQL 和 JPQL 查询、聚合操作符 | ✓ |
HQL 和 JPQL 查询、算术操作符 | 部分支持。支持 要了解更多信息,请参阅《指定查询》指南中的使用计算表达式部分。 |
HQL 和 JPQL 查询、数组操作符 | ✓ |
HQL 和 JPQL 查询,日期时间函数 | 部分支持。在 |
HQL 和 JPQL 查询,字符串函数 | 部分支持。支持 |
HQL 和 JPQL 查询,Case 表达式 | 部分支持。
有关更多信息并查看示例,请参阅《指定查询》指南中的“用于条件逻辑的使用案例表达式”部分。 |
HQL 和 JPQL 查询、比较操作符 |
|
HQL 和 JPQL 查询、元素操作符 | ✓ |
HQL 和 JPQL 查询、评估操作符 | 部分支持。通过将 |
HQL 和 JPQL 查询,分组 | 部分支持。支持
|
HQL 和 JPQL 查询、连接 | 部分支持。您可以通过导航映射的关联(如
|
HQL 和 JPQL 查询,逻辑操作符 | ✓ |
HQL 和 JPQL 查询,字符串函数 | 部分支持。支持 |
数据库和集合支持
Hibernate ORM 功能 | 正式可用性 (GA) 支持 |
|---|---|
一级缓存 | ✓ |
二级缓存 | ✓ |
框架和库支持
本部分指示 Hibernate ORM 扩展是否支持各种外部框架或库。
框架或库 | 正式可用性 (GA) 支持 |
|---|---|
Spring Boot 和 Spring Data JPA | 部分支持。Hibernate ORM 扩展提供一个 Spring Boot 启动器,用于配置由 MongoDB 支持的 JPA 和 Spring Data JPA 存储库。我们不保证支持 Spring Boot 或 Spring Data 的所有功能。要了解更多,请参阅 Spring Boot 和 Spring Data JPA 集成 部分。 |