【问题标题】:Update hbm.xml file to hibernate 5 for hibernate.spatial.GeometryType将 hbm.xml 文件更新为 hibernate 5 的 hibernate.spatial.GeometryType
【发布时间】:2016-02-26 15:41:25
【问题描述】:

我有一个 Location.hbm.xml 文件,其中包含以下行:

<property name="coordinates" type="org.hibernate.spatial.GeometryType">
        <column name="coordinates" />
</property>

我们正在更新到休眠 5,并且不再有 GeometryType 对象。我应该改用什么类?

【问题讨论】:

    标签: hibernate hibernate-spatial


    【解决方案1】:

    在 Hibernate 5 中,Hibernate Spatial 比以前更紧密地集成在 Hibernate-core 中。如果您的坐标属性是 JTS Geometry 类型,并且 hibernate-spatial 5 在类路径上,它应该会自动解析。该类型在类型注册表中有键 jts_geometry

    【讨论】:

    • 换句话说我应该使用以下?
    • 知道了。 type 属性是可选的,所以我应该省略它。
    猜你喜欢
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-19
    • 2015-02-22
    相关资源
    最近更新 更多