Overview
在此页面上,您可以找到有关 Hibernate ORM 扩展支持和不支持的功能的信息。 Hibernate ORM 扩展仅支持MongoDB副本集。当您使用不支持的功能时,Hibernate ORM 扩展会引发 UnsupportedFeatureException。
您还可以在此页面上找到当前计划在未来版本中提供的功能。我们将根据用户需求对这些即将推出的功能进行优先级排序,您可以通过 创建 AHA 创意请求对某项功能的支持。
MongoDB Extension for Hibernate ORM 目前提供公共预览版。不建议将公共预览版用于生产部署,因为可能会引入重大更改。
MongoDB功能
本部分指示 Hibernate ORM 扩展是否支持各种MongoDB功能。
数据类型支持
要查看 Hibernate ORM 扩展支持的所有BSON 类型的列表,请参阅创建实体指南中的 MongoDB BSON字段部分。
查询支持
MongoDB功能 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
批量写入 | ✓ | ✓ |
删除操作 | ✓ | ✓ |
地理空间查询 | 不受支持。但是, | 我们正在考虑在 GA发布中提供此功能。 |
插入操作 | ✓ | ✓ |
MongoDB Search 查询 | 我们正在考虑在 GA发布中提供此功能。 | |
MongoDB Vector Search 查询 | 我们正在考虑在 GA发布中提供此功能。 | |
使用MQL进行原生查询 | Partially Supported. Parameter binding is not supported. | ✓ |
投影 | 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. |
读取操作 | ✓ | ✓ |
更新操作 | ✓ | ✓ |
更新或插入操作 | 不受支持。但是,您可以先查询集合以检查指定的值是否存在,然后在该值存在时进行插入或更新。 | 我们正在考虑在 GA发布中提供此功能。 |
数据库和集合支持
MongoDB功能 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
Change Streams | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
客户端字段级加密(CSFLE) 和Queryable Encryption(QE) | 不受支持。但是,您可以在配置MongoDB Java驱动程序时设置CSFLE/QE。 | 我们正在考虑在 GA发布中提供此功能。 |
GridFS | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
时间序列数据 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
视图 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
事务和并发
MongoDB功能 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
锁定 | 部分支持。支持乐观锁。 | 我们正在考虑在 GA发布中提供此功能。 |
事务 | ✓ | ✓ |
映射和模型支持
MongoDB功能 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
关联 | 不支持。 | ✓ |
自动生成 ID | 部分支持。支持自动生成 ObjectId。但是,您可以手动设立UUID。 | 我们正在考虑在 GA发布中提供此功能。 |
继承策略 | 不支持。 | ✓ |
延迟/预先获取 | 不支持。 | 不支持。 |
排序 | ✓ | ✓ |
验证 | ✓ | ✓ |
索引支持
MongoDB功能 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
固定大小集合 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
集群化集合 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
复合索引 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
嵌入式文档索引 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
地理空间索引 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
MongoDB Search 索引 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
MongoDB Vector Search 索引 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
多键索引 | 不受支持。对大量字段使用默认MongoDB行为。 | 我们正在考虑在 GA发布中提供此功能。 |
部分索引 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
模式验证 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
单字段索引 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
稀疏索引 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
Unique indexes | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 我们正在考虑在 GA发布中提供此功能。 |
创建模型后更新嵌入式模型索引 | 不受支持。但是,您可以手动删除并重新创建嵌入式模型索引。 | 我们正在考虑在 GA发布中提供此功能。 |
Hibernate ORM 功能
本部分指示 Hibernate ORM 扩展是否支持各种 Hibernate ORM 功能。
数据类型支持
数据类型 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
集合类型(列表、集、映射、数组) | ✓. @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. |
可嵌入式实体、标量类型 | 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. |
嵌入式实体,二进制 | ✓ | ✓ |
嵌入式实体、标识符类型 | Partially Supported. Manually set the ID of an entity before persisting an entity. | We are considering this feature for GA release. |
嵌入式实体, JSON | ✓ | ✓ |
嵌入式实体、空语义 | ✓ | ✓ |
顶级实体,二进制 | ✓ | ✓ |
顶级实体、标识符类型 | ✓ Manually assign UUIDs before persisting an entity. | ✓ Manually assign UUIDs before persisting an entity. |
顶级实体, JSON | ✓ | ✓ |
顶级实体、空语义 | ✓ | ✓ |
顶级实体、标量类型 | ✓ | ✓ |
顶级实体、时态类型 | 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. |
三元逻辑(True、False 或 UNKNOWN) | 不受支持。 | 已计划。 |
查询支持
Hibernate ORM 功能 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
HQL 和 JPQL 查询、聚合操作符 | 已计划。 | |
HQL 和 JPQL 查询、算术操作符 | 我们正在考虑在 GA发布中提供此功能。 | |
HQL 和 JPQL 查询、数组操作符 | ✓ | ✓ |
HQL 和 JPQL 查询、比较操作符 | 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 和 JPQL 查询、元素操作符 | ✓ | ✓ |
HQL 和 JPQL 查询、评估操作符 | 已计划。 | |
HQL 和 JPQL 查询、联接 | 不受支持。但是,您可以使用MongoDB Java驱动程序来定义 | 已计划。 |
HQL 和 JPQL 查询,逻辑操作符 | ✓ | ✓ |
数据库和集合支持
Hibernate ORM 功能 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
一级缓存 | ✓ | ✓ |
二级缓存 | ✓ | ✓ |
框架和库支持
本部分指示 Hibernate ORM 扩展是否支持各种外部框架或库。
框架或库 | 公共预览版支持 | 正式可用性 (GA) 支持 |
|---|---|---|
Spring Boot 和 Spring Data | 部分支持。我们不保证支持所有 Spring Boot 或 Spring Data 功能。有关使用 Hibernate ORM 扩展和 Spring Data 制作的应用的示例,请参阅带有MongoDB Hibernate App 的 Spring Data 。 | 部分支持。我们不保证支持所有 Spring Boot 或 Spring Data 功能。有关使用 Hibernate ORM 扩展和 Spring Data 制作的应用示例,请参阅带有MongoDB Hibernate App 的 Spring Data。 |