当我尝试将 Point 数据类型持久保存到 postgres DB 时,它失败并出现错误 org.postgresql.util.PSQLException: ERROR: column "pointColumn" is of type point but expression is of type geometry
这是我的 pojo snappit
@Type(type="org.hibernate.spatial.GeometryType")
@Column(columnDefinition="Point", nullable = true)
private Point pointColumn;
这是我的驱动程序和方言属性
driverClass=org.postgresql.Driver
方言=org.hibernate.spatial.dialect.postgis.PostgisDialect
这是我的空间版本详细信息
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version>
</dependency>
即使我已经将 GeometryType 注册到 jdbc 配置,如下所示
GeometryType geometryType = new GeometryType();
configuration.registerTypeOverride(geometryType);
甚至这个问题对于 Polygon、LineString、Point、MultiPoint、MultiPolygon 也是如此……
我是否缺少任何配置或几何类型实现的预期行为?