0

My Entity class

@Type(type = "org.hibernate.spatial.GeometryType")
private Point location;

My spring boot configuration

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

I get the following error while trying to save.

ERROR: column "location" is of type point but expression is of type bytea Hint: You will need to rewrite or cast the expression. Position: 154

1 Answer 1

1

Seems like You're trying to store postgis geometry(point) data type into field which data type is postgresql point. They are not the same

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks so how do I represent the postgis point type in my entity pojo using spring JPA.
Maybe try from the other way - change data type of column in database into geometry

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.