hibernate - hibernate 混合了vividsolutions.jts Geometry 和locationtech.jts.Geometry
问题描述
在我的 JPA 实体中,我有以下内容:
import org.locationtech.jts.geom.Geometry;
....
....
@Column(name = "geometry")
private Geometry geometry;
我正在使用 h2 gis 进行单元测试。当测试执行时,它会给出错误:
Caused by: org.h2.jdbc.JdbcSQLException: Feature not supported: "converting to class com.vividsolutions.jts.geom.Geometry"
为什么它试图映射到不同的类。
我的部门是:
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts</artifactId>
<version>1.15.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.197</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.orbisgis</groupId>
<artifactId>h2gis</artifactId>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
解决方案
您不能使用不兼容的 H2、H2GIS 和 JTS 版本。
H2GIS 1.4.0 需要来自 Vivid Solutions 的 H2 1.4.196 和 JTS 1.14。
H2GIS 1.5.0 需要 LocationTech 的 H2 1.4.197 和 JTS 1.15。
如果你想使用更新版本的 H2,你需要使用一些快照版本的 H2GIS。
推荐阅读
- php - 传递给 Sonata\PageBundle\Entity\BlockInteractor::__construct() 的参数 1 必须是 Symfony\Bridge\Doctrine\RegistryInterface 的一个实例
- wordpress - 无法在我的 wordpress 网站中包含联盟斯巴达家庭
- c++ - 如何在 std::pair 中使用 System::Guid 和自定义枚举?
- spring - 可重试注释在春季批处理应用程序中不起作用
- java - 在不提供架构的情况下使用 Apache Beam Java SDK 读取 Parquet 文件
- file - Unity:如何在主文件夹中获取文件夹然后检索文件?
- java - 如何在下面的 HTML 代码中找到硬橡胶球的 xpath?
- c# - 在 Unity 中缓慢上下移动对象?
- user-interface - 单击图像中存在的非语言按钮时,我想在代码下方的空间中显示 4 行 4 列的菜单,我该怎么做?
- android - firebase_messaging W/FirebaseMessaging(11255):AndroidManifest 中缺少默认通知通道元数据。将使用默认值