我想使用MySQL 10和Point for Geolocations。 我的方言属性是:
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
我在实体上立即使用:
@Column(name="location", columnDefinition = "POINT")
private org.springframework.data.geo.Point location;
错误消息是:
com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Cannot get geometry object from data you send to the GEOMETRY field
我尝试使用JpaRepository => save()保存它
使用JPA可以吗?
答案 0 :(得分:0)
spring.jpa.properties.hibernate.dialect = org.hibernate.spatial.dialect.mysql.MySQL56InnoDBSpatialDialect
spring.jpa.properties.hibernate.dialect = org.hibernate.spatial.dialect.h2geodb.GeoDBDialect 尝试使用两种版本的方言时,不确定哪一种将满足您的需求