2

My use case is the following :

When user is at a certain location , i need to find all Touchpoints within a certain radius of his location.

My Touchpoint Class looks like this :

public class TouchPoint{

    private String pointName;

    private String pointDescription

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

I have the following added in my POM :

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

I also have the JPA dialect set for Mysql Spatial extension :

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

My data gets loaded properly but i am not able to get my hibernate query to work to get all points within a certain radius of a given lat,long.

I am not sure how i can get the within query to work with Spring data jpa.

Abhishek Ranjan
  • 911
  • 1
  • 14
  • 29

0 Answers0