Hibernate Spatial 5 - GeometryType

后端 未结 6 1965
刺人心
刺人心 2021-02-01 16:36

After upgrading Hibernate-spatial to Version 5.0.0.CR2 the following declaration doesn\'t work anymore:

@Column(columnDefinition = \"geometry(Point,4326)\")
@Typ         


        
6条回答
  •  执笔经年
    2021-02-01 17:01

    Apparently your Hibernate libraries need to be at the same version too.

    I was using postgis / springboot / hibernate-spatial.

    Initially Hibernate-Spatial was @ 5.4.10.Final, and didn't work even with the solutions here.

    I then looked at what version of hibernate was in my maven dependencies ( hibernate-commons-annotations-5.1.0.Final.jar) and remembered seeing somewhere that the versions of hibernate need to match.

    So I downgraded my Hibernate-Spatial, to 5.1 and the following mapping statement works without any more info:

    // Geometry Object is from the following import
    import com.vividsolutions.jts.geom.*;
    
    @Column(name="domain_loc")
    private Geometry location;
    

提交回复
热议问题