Querydsl和MySQL-distancesphere不存在

Querydsl和MySQL-distancesphere不存在,mysql,querydsl,hibernate-spatial,Mysql,Querydsl,Hibernate Spatial,我将QueryDSL v4.1.4与Spring Boot和Hibernate 5一起使用 我的目标是基于ST_DISTANCE_SPHERE函数执行查询,以基于距起点的距离查询结果 我有以下疑问: where .and( QAddress.address.geoPoint.point.distanceSphere( ExpressionUtils.toExpression(GeocoderUtils.geometryFactory.cr

我将QueryDSL v4.1.4与Spring Boot和Hibernate 5一起使用

我的目标是基于
ST_DISTANCE_SPHERE
函数执行查询,以基于距起点的距离查询结果

我有以下疑问:

where
     .and(
         QAddress.address.geoPoint.point.distanceSphere(
               ExpressionUtils.toExpression(GeocoderUtils.geometryFactory.createPoint(new Coordinate(longitude, latitude)))
         ).loe(distance)
     );
其中,
QAddress.address.geoPoint.point
为JTS点,
geometryFactory
具有SRID=4326和
PrecisionModel.MaximumPreciseSValue

MySQL(以及orbisgis中的H2)中产生的异常是:

额外:

    application.yml: 
    database-platform: org.hibernate.spatial.dialect.mysql.MySQL5InnoDBSpatialDialect

    build.gradle
    compile group: 'com.querydsl', name: 'querydsl-jpa', version: '4.1.4'
    compile group: 'com.querydsl', name: 'querydsl-sql', version: '4.1.4'
    compile group: 'com.querydsl', name: 'querydsl-sql-spatial', version: '4.1.4'
    compile group: 'com.querydsl', name: 'querydsl-sql-spring', version: '4.1.4'
    compile("com.vividsolutions:jts:1.13")
    compile "org.hibernate:hibernate-spatial:${hibernate_version}"
    compile 'com.bedatadriven:jackson-datatype-jts:2.4'
    testCompile group: 'org.orbisgis', name: 'h2gis', version: '1.4.0'
    testCompile('com.h2database:h2:1.4.196')
    testCompile group: 'org.opengeo', name: 'geodb', version: '0.8'
    ... and so on
Ps.使用EntityManager创建的查询,使用
st_distance_sphere
,正常执行查询,表明MySQL已正确配置为处理地理功能


谢谢

我不确定QueryDSL如何翻译查询。在任何情况下,Hibernate Spatial当前都不支持
st_distance_sphere
功能

谢谢!现在,我发现了另一个问题,表明您在hibernate上的未决问题。
    application.yml: 
    database-platform: org.hibernate.spatial.dialect.mysql.MySQL5InnoDBSpatialDialect

    build.gradle
    compile group: 'com.querydsl', name: 'querydsl-jpa', version: '4.1.4'
    compile group: 'com.querydsl', name: 'querydsl-sql', version: '4.1.4'
    compile group: 'com.querydsl', name: 'querydsl-sql-spatial', version: '4.1.4'
    compile group: 'com.querydsl', name: 'querydsl-sql-spring', version: '4.1.4'
    compile("com.vividsolutions:jts:1.13")
    compile "org.hibernate:hibernate-spatial:${hibernate_version}"
    compile 'com.bedatadriven:jackson-datatype-jts:2.4'
    testCompile group: 'org.orbisgis', name: 'h2gis', version: '1.4.0'
    testCompile('com.h2database:h2:1.4.196')
    testCompile group: 'org.opengeo', name: 'geodb', version: '0.8'
    ... and so on