Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate 尝试使用Postgis将点保存到Postgres DB时出错_Hibernate_Spring Boot_Postgis - Fatal编程技术网

Hibernate 尝试使用Postgis将点保存到Postgres DB时出错

Hibernate 尝试使用Postgis将点保存到Postgres DB时出错,hibernate,spring-boot,postgis,Hibernate,Spring Boot,Postgis,我的实体类 @Type(type = "org.hibernate.spatial.GeometryType") private Point location; 我的spring引导配置 spring.jpa.database=POSTGRESQL spring.datasource.platform=postgres spring.jpa.show-sql=true #spring.jpa.hibernate.ddl-auto=validate spring.datasource.drive

我的实体类

@Type(type = "org.hibernate.spatial.GeometryType")
private Point location;
我的spring引导配置

spring.jpa.database=POSTGRESQL
spring.datasource.platform=postgres
spring.jpa.show-sql=true
#spring.jpa.hibernate.ddl-auto=validate
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=****
spring.datasource.username=***
spring.datasource.password=**
spring.jpa.database-platform=org.hibernate.spatial.dialect.postgis.PostgisDialect
在尝试保存时出现以下错误


错误:“location”列的类型为point,但表达式的类型为bytea提示:您需要重写或强制转换表达式。位置:154

似乎您正在尝试将postgis存储到数据类型为的字段中。它们不一样

谢谢,那么如何使用spring JPA在我的实体pojo中表示postgis点类型。也许可以尝试从另一种方式—将数据库中列的数据类型更改为几何体