hibernate-spatial

How to configure spring-boot project to work with inmemory spatial database for tests?

╄→гoц情女王★ 提交于 2019-12-12 18:07:45
问题 Here is my config now. I want to use hibernate spatial to work with postgis in production. spring: profiles: production datasource: platform: postgres url: jdbc:postgresql://192.168.99.100:5432/dragon username: dragon password: dragon database: driverClassName: org.postgresql.Driver jpa: database: POSTGRESQL database-platform: org.hibernate.spatial.dialect.postgis.PostgisDialect show-sql: true hibernate: ddl-auto: update --- spring: profiles: development datasource: SpatialInMemoryDb jpa:

Find points within a circle using hibernate Spatial criteria - distanceWithin

两盒软妹~` 提交于 2019-12-11 16:54:39
问题 I have a domain object car . One of the car properties is location stored in MySQL as spatial type Point ( columnDefinition can't be of Geometry , throws an exception). @Type(type="org.hibernate.spatial.GeometryType") @Column(name = "location", columnDefinition="Point") private Point location; Using hibernate spatial criteria I would like to get those that are in a certain radius. In native sql I could use ST_Distance_Sphere , but I would like to use criteria instead. The problem is, that

Couldn't get at the OracleSpatial Connection object from the PreparedStatement

依然范特西╮ 提交于 2019-12-11 03:49:19
问题 i am using hibernate spatial 4.3.2 along with hibernate 4.3.11 and my db is oracle 12c. I use hikariCP for connection pool. when I use hikacriCP I get an error that seems that cause is hibernate spatial can not access to the wrapped connection of hikari connection instance, this is my exception: problem is hibernate throws error when saving an entity that contains geometry field. Couldn't get at the OracleSpatial Connection object from the PreparedStatement when I remove hikari, everything is

Why I can't map a Point field of my entity class on a Point field on the database? column “location” is of type point but expression is of type bytea

淺唱寂寞╮ 提交于 2019-12-09 19:25:47
问题 I am working on my first Spring Boot + Spring Data JPA + Hibernate 5 working on a PostgreSQL database. I have the following problem trying to map a field having point as data type (so I am using Hibernate Spatial that is natively included into Hibernate 5. So I have the following situation: I have the following simple database table named cities: Field Type ---------------------------------------------------------------- id bigint (it is the PK) name character varying location point (it

hibernate-spatial: sql query to retrieve a geometry

ぐ巨炮叔叔 提交于 2019-12-09 16:43:19
问题 I'm using postgresql, hibernate-spatial and postgis and expected to be able to use a SqlQuery to retrieve a Geometry object. However whenever I try to query a Point, Polygon or Geometry eg List list = session.createSQLQuery( "select geomfromewkt('SRID=1;POINT(1 1)')").list(); I get the exception: Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111 at org.hibernate.dialect.TypeNames.get(TypeNames.java:78) at org.hibernate.dialect.TypeNames.get(TypeNames.java:103)

Not finding Oracle Connection when a PostGIS connection is defined

▼魔方 西西 提交于 2019-12-08 09:08:49
问题 I have an application running with Spring 3.1.1 , Hibernate 3.6.0.Final and Hibernate Spatial 1.1.1 on Tomcat 8.0.20. Until now, we were using Oracle 11.2.0.4 , but we want to migrate to PostgreSQL 9.2-1002.jdbc4 / PostGIS 2.1.6. We will migrate the database schemas on different phases, so at some stage, we will need some connections to be working with Oracle and some with PostGIS. In order to begin developing and testing this, I removed any Oracle Maven dependency and added the necessary

Spatial Hibernate 5 On Wildfly 10

大兔子大兔子 提交于 2019-12-06 07:59:32
问题 I am using Wildfly 10 and developing an application using Spatial Hibernate 5 with PostGIS database. I am getting the below error in runtime. java.lang.IllegalStateException: Received object of type org.postgresql.util.PGobject Can anyone suggest some good tutorials as on how to use Spatial Hibernate with Wildfly 10? 回答1: I had the same problem and I just fixed it. It is basically a dependency issue. The problem is that you are loading the postgresql and/or postgis jars on your wildfly

Why I can't map a Point field of my entity class on a Point field on the database? column “location” is of type point but expression is of type bytea

旧城冷巷雨未停 提交于 2019-12-04 15:51:38
I am working on my first Spring Boot + Spring Data JPA + Hibernate 5 working on a PostgreSQL database. I have the following problem trying to map a field having point as data type (so I am using Hibernate Spatial that is natively included into Hibernate 5. So I have the following situation: I have the following simple database table named cities: Field Type ---------------------------------------------------------------- id bigint (it is the PK) name character varying location point (it contains the coordinates) So for example this table contains this record: id name locoation ----------------

Hibernate Spatial 5 - GeometryType

匆匆过客 提交于 2019-12-03 08:24:33
问题 After upgrading Hibernate-spatial to Version 5.0.0.CR2 the following declaration doesn't work anymore: @Column(columnDefinition = "geometry(Point,4326)") @Type(type = "org.hibernate.spatial.GeometryType") private Point position; with an: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.spatial.GeometryType] As I can see the class doesn't exist in the Jar-File anymore. What happend to the GeometryType and how is it replaced? Or is there

Hibernate Spatial - Query within an X kilometer radius?

孤人 提交于 2019-12-03 04:31:02
问题 I am new to Hibernate Spatial, and am trying to perform a simple query of objects within a given radius. I've created a number of entries in my database with properties corresponding to a latitude and longitude, using data from Google Maps and other sources. This property is defined like this in my Entity class: @Column @Type(type = "org.hibernate.spatial.GeometryType") private Point coordinates = null; I'm now trying to figure out how to do a search of all entity objects that have