spring数据地理空间查询

yzuktlbb  于 2021-06-23  发布在  Mysql
关注(0)|答案(0)|浏览(142)

我的用例如下:
当用户在某个位置时,我需要找到他所在位置的某个半径内的所有接触点。
我的接触点类如下所示:

public class TouchPoint{

    private String pointName;

    private String pointDescription

    @Column(columnDefinition = "POINT")
    private Point location;
}

我的pom中添加了以下内容:

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-spatial</artifactId>
</dependency>

我还为mysql空间扩展设置了jpa方言:

spring.jpa.properties.hibernate.dialect = org.hibernate.spatial.dialect.mysql.MySQL56SpatialDialect

我的数据被正确加载,但我无法让我的hibernate查询工作,以获取给定lat,long的某个半径内的所有点。
我不确定如何让within查询使用spring数据jpa。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题