Hibernate Spatial is a generic extension to Hibernate for handling geographic data. Hibernate Spatial is open source and licensed, like Hibernate, under the LGPL license. Hibernate Spatial allows you to deal with geographic data in a standardized way. It abstracts away from the specific way your database supports geographic data, and provides a standardized, cross-database interface to geographic data storage and query functions.
Questions tagged [hibernate-spatial]
161 questions
5
votes
3 answers
How to correctly map a polygon type with postgis and hibernate-spatial?
Assume I have the following table
CREATE TABLE foo (
id BIGSERIAL PRIMARY KEY,
polygon GEOMETRY(POLYGON)
);
and entity class
@Table
@Entity
public class Foo {
@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;
private…

Bravo
- 1,944
- 4
- 29
- 53
5
votes
1 answer
Hibernate 5.0.1 with PostGIS data stored as bytes instead of spatial types
I'm trying to setup a new project with the following combination of technologies
Hibernate + spatial 5.0.1
PostgreSQL 9.4 with PostGIS 2.1.8
Spring 4.2.1
JTS 1.13
Entity. I found that org.hibernate.spatial.GeometryType has been removed, and now…

Adam
- 35,919
- 9
- 100
- 137
5
votes
1 answer
Query all Object within n kilometer Radius with Hibernate Spatial?
I use hibernate spatial attach a geolocation to a car. My card domain class looks like this:
import com.vividsolutions.jts.geom.Point
class Card {
String name
Point location
}
My program is in Grails so the samples I gave are in Groovy. I…

Michael
- 32,527
- 49
- 210
- 370
5
votes
1 answer
Auditing with Envers and Hibernate Spatial 4
I'm attempting to use Envers to set up Auditing on my Hibernate entities. However, I'm getting the error:
Could not determine type for: geometry, at table: Location_AUD, for columns: [org.hibernate.mapping.Column(geom)]
Hibernate is happy with the…

Luke
- 100
- 7
5
votes
2 answers
Hibernate-Spatial Query for Points within an area
Dear stackoverflow readers,
I'm currently working on an application that has the requirement to load specific items based on its coordinates. Example: I want all shops from coordinates x or within 15 km of it.
I have been building this web…

Wouter
- 1,290
- 2
- 16
- 24
4
votes
1 answer
Cannot get geometry object from data you send to the GEOMETRY field : Hibernate Spatial + Mysql
I am trying to save Point data using Hibernate in Mysql. But I am not able to understand what am I doing wrong?
I am using hibernate 5.3.6, jts 1.14, mysql-connector-5.1.18.
The database has three fields id, name and curr_loc with type int, varchar…

Kiara
- 117
- 1
- 1
- 11
4
votes
2 answers
Received object of type org.postgresql.util.PGobject
I can insert geometry data into database from my code, but I can only query the data using an SQL editor, like PGAdmin III. I can't retrieve geometry data back to my code. Every attempt ends up with: "Received object of type…

Maverick_Java
- 5,665
- 2
- 13
- 15
4
votes
1 answer
Configuring spring boot with hibernate spatial
Hello I have problem with booting up my spring app. Hibernate produce following error HHH000206: hibernate.properties not found.
My POM looks like this :
org.springframework.boot
…

PaaZ
- 71
- 1
- 4
4
votes
1 answer
Hibernate spatial ServiceConfigurationError
Hey I've been trying to set up Hibernate Spatial to query geographical data stored in PostGreSQL. I getting the following error while trying to run my code.
session factory creation failed
java.util.ServiceConfigurationError:…

ashkhn
- 1,642
- 1
- 13
- 18
3
votes
1 answer
Wrong column type after upgrading from Hibernate Spatial 5.4.3 to 5.6.9
We're trying to upgrade Hibernate and Hibernate Spatial from version 5.4 to 5.6 (we're using MySQL 5.6) but when starting our Spring Boot application (running spring boot 2.7.0) we run into the following exception:
Caused by:…

Johan
- 37,479
- 32
- 149
- 237
3
votes
2 answers
How to insert into geo point column in spring data-jpa + mysql 8?
My Environment
mysql 8.0.25
hibernate-core:5.4.32
hibernate-spatial:5.4.32
spring-boot2.5.4
java 8
What I did
application.yml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url:…

Jerry
- 399
- 1
- 2
- 17
3
votes
1 answer
org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Function "WITHIN" not found; SQL statement
Here I am trying to find all those entities who are within the range I provide. I mean if I give a circle of certain radius, it will have to show all entities having location coordinates positioned inside the given circle.
I am using…

Chinmoy Acharjee
- 520
- 5
- 16
3
votes
3 answers
Spring Data repository and native query with Geometry return type
I'm creating a project that uses some spatial queries.
I use Spring boot with spring data repositories and PostgreSQL with PostGIS extension as database.
I created this repository:
import com.vividsolutions.jts.geom.Geometry;
import…

Bart
- 496
- 10
- 23
3
votes
0 answers
JPA criteria: spatial restrictions
I cannot find any way to use spatial criteria with Hibernate 5.2. Using criteria is not a problem:
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery cq = cb.createQuery(geoObjectClass);
Root root =…

Jeroen
- 61
- 4
3
votes
0 answers
Why can't Hibernate tools in Eclipse find the OracleSpatial10gDialect class when I reverse engineer?
I added the hibernate-spatial dependency to my pom, and I can see the jar gets downloaded after I update the project. When I run the app it works fine using the spatial dialect, but when I try to reverse engineer in Eclipse it tells…

Mike B
- 5,390
- 2
- 23
- 45