【问题标题】:Is it possible to have ressources in other project (Spring Boot)?是否可以在另一个项目(Spring Boot)中拥有资源?
【发布时间】:2019-02-27 21:03:47
【问题描述】:

我想使用 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 可以吗?

【问题讨论】:

    标签: mysql jpa geolocation spring-data-jpa


    【解决方案1】:

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

    spring.jpa.properties.hibernate.dialect=org.hibernate.spatial.dialect.h2geodb.GeoDBDialect 尝试两种版本的方言,不确定哪一种适合您的需求

    【讨论】:

    • 当我使用第一个时,我收到消息:原因:org.hibernate.boot.registry.selector.spi.StrategySelectionException:无法解析名称 [org.hibernate.spatial.dialect.mysql. MySQL56InnoDBSpatialDialect] 作为策略 [org.hibernate.dialect.Dialect] 第二个是用于 h2 数据库,不适合:(
    • 发布你的 Pom 或等级配置应该是依赖问题
    猜你喜欢
    • 2020-10-26
    • 1970-01-01
    • 1970-01-01
    • 2018-08-30
    • 2016-12-03
    • 1970-01-01
    • 2020-08-23
    • 2018-07-24
    • 1970-01-01
    相关资源
    最近更新 更多