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点类型。也许可以尝试从另一种方式—将数据库中列的数据类型更改为几何体