Hibernate Spatial 5 - GeometryType

后端 未结 6 1882
刺人心
刺人心 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条回答
  •  梦毁少年i
    2021-02-01 17:03

    The solution suggested by Denis above did not work for me on Hiberate 5 spatial and Mysql. However the following annotations worked for me

      @Column(name = "location",columnDefinition="Geometry")
      private Geometry location;
    
    
      @Column(name = "pointlocation",columnDefinition="Point")
      private Point pointlocation;
    

    If you are running Hibernate 5.3+ you can skip out on column definitions

      @Column(name = "location")
      private Geometry location;
    
    
      @Column(name = "pointlocation")
      private Point pointlocation;
    

提交回复
热议问题