You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do not seem to be able to store a Point in a MySQL8 database using Java 18 and Hibernate 6.2.
When I try I get a stack trace:
o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1406, SQLState: 22001
o.h.engine.jdbc.spi.SqlExceptionHelper : Data truncation: Data too long for column 'location' at row 1
It may very well be that they way I am trying to do this is wrong. I have inspected the table and the column type created is varbinary(255).
@Entity
@Data
public class Check {
@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;
private Point location;
// getters and setters
// constructors
Neither location nor geometry works. To be honest I am lost as to what format the database wants? I would expect given the column type of varbinary that it might be WKB - but I am not sure.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I do not seem to be able to store a Point in a MySQL8 database using Java 18 and Hibernate 6.2.
When I try I get a stack trace:
It may very well be that they way I am trying to do this is wrong. I have inspected the table and the column type created is varbinary(255).
The code I am using in a Unit test is :
Neither location nor geometry works. To be honest I am lost as to what format the database wants? I would expect given the column type of varbinary that it might be WKB - but I am not sure.
Beta Was this translation helpful? Give feedback.
All reactions