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?

boybeak
  • 417
  • 5
  • 19

0 Answers0