I am trying to query spatial data using the below native query. and I am getting below exception in doing so.
@Query(nativeQuery = true, value = "SELECT \* FROM locations WHERE ST_Contains(polygon, ST_Transform(ST_SetSRID(ST_MakePoint(:x, :y), 4326), 3785))")
List\<Location\> test(@Param("x") double x,@Param("y") double y);
Exception I am getting
ERROR: function st_makepoint(double precision, double precision) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts.
tried adding the below configs
hibernate-spatial dependency
properties.put("hibernate.dialect", "org.hibernate.spatial.dialect.postgis.PostgisPG95Dialect");`
Note: If I execute same query directly on db , its working