1
@Entity(name = "records")
data class RecordEntity(
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        val uid: Long = 0,
        @Column(columnDefinition = "geometry(Point,4326)")
        val position: Point
) {
}

When I do insert operation, the error Invalid endian flag value encountered happened.

The position column's data type is Geometry at this moment.

I removed @Column(columnDefinition = "geometry(Point,4326)") this line, then it works fine. But another error Invalid endian flag value encountered when I do query with sql command SELECT u FROM public.records u WHERE ST_Distance_Sphere(u.position, ST_MakePoint(0.0, 0.0)) <= 18*1000

The position column's data type became bytea after removing @Column line.

How should I do to make it works perfectly with Spring boot, Hibernate spatial 5 and PostGIS?

5
  • Sounds like a bug. What database, version and OS are you using? Commented Oct 18, 2019 at 8:36
  • PostgreSQL with PostGIS extension, version 10; And Hibernate spatial version 5.4.5.Final Commented Oct 18, 2019 at 10:08
  • I've created a bug ticket for this issue and will try to reproduce. But what Operating System are you using? Commented Oct 19, 2019 at 11:38
  • MacOS 0.15 (19A583), and PostgreSQL detail version is postgresql-10.10-1-osx.dmg Commented Oct 20, 2019 at 7:39
  • I recreate a new project, and now it's works fine. Commented Oct 23, 2019 at 7:22

0

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.