While trying to persist an object with an attribute of type Point, defined as follows:
@Entity
@Table(name = "event")
public class Event {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private long id;
@Column(columnDefinition = "POINT")
private Point coordinate;
}
I'm getting the error Data truncation: Cannot get geometry object from data you send to the GEOMETRY field.
The corresponding database table is defined as follows:
create table event
(
id bigint not null auto_increment,
coordinate POINT,
primary key (id)
)
engine= InnoDB;
What am I missing?