0

我正在使用 Java、Spring boot、MySQL 和数据 JPA。在这里检查我的代码

@Column(name = "point", columnDefinition = "POINT")
private Point point;

在我的 application.properties 文件中,我添加了

spring.jpa.properties.hibernate.dialect = org.hibernate.spatial.dialect.mysql.MySQL56SpatialDialect

在传递 JSON 时,"point": "51.61100420, -0.10213410"我遇到了这个错误

> “JSON 解析错误:无法构造实例org.springframework.data.geo.Point(尽管至少存在一个 Creator):没有字符串参数构造函数/工厂方法可以从字符串值反序列化('(51.61100420,-0.10213410)');嵌套异常是 com.fasterxml。 jackson.databind.exc.MismatchedInputException:无法构造实例org.springframework.data.geo.Point(尽管至少存在一个创建者):没有字符串参数构造函数/工厂方法可以从字符串值反序列化('(51.61100420,-0.10213410)')\n 在 [来源: (PushbackInputStream);行:11,列:12]

请帮我解决这个问题,在此先感谢

4

0 回答 0