【问题标题】:Exception postGIS Geometry Mapping with JPA使用 JPA 进行异常 postGIS 几何映射
【发布时间】:2013-11-07 03:23:25
【问题描述】:

我正在使用

Hibernate-Core 4.1.4 最终版

休眠空间 4.0-M1

JTS 1.8

休眠空间postgis 1.1.1

在带有 JPA 2.0 的 JBoss 7.1 上

我正在尝试将几何列(带有 postgis 的 OpenStreetMap 数据库)映射到这样的 JPA 实体:

import org.hibernate.annotations.Type;
import com.vividsolutions.jts.geom.Geometry;

@Type(type="org.hibernate.spatial.GeometryType")
@Column(name = "way", nullable = true)
private Geometry geom;

连接似乎很好,其他列也可以很好地反序列化。使用几何列,我得到了这个异常:

 java.lang.UnsupportedOperationException
at org.hibernate.spatial.GeometrySqlTypeDescriptor.getExtractor(GeometrySqlTypeDescriptor.java:57)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:269)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:265)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:238)
at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:357)

...

【问题讨论】:

    标签: java hibernate jpa postgis


    【解决方案1】:

    喜欢这篇文章

    http://hibernate-spatial.1140993.n2.nabble.com/Deserializing-my-Spatial-Objects-td6686115.html

    我发现当我将注解移到getter时,错误就消失了

    【讨论】:

      猜你喜欢
      • 2016-08-13
      • 2014-01-22
      • 1970-01-01
      • 2015-02-21
      • 2018-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多