Open spring-projects-issues opened 5 years ago
Jesse Kuhnert commented
I just noticed this block at bottom of constructor while browsing querydsl APT annotation generator config class (DefaultConfiguration.java) :
try {
// register additional mappings if querydsl-spatial is on the classpath
Class.forName("com.querydsl.spatial.GeometryExpression");
SpatialSupport.addSupport(module);
} catch (Exception e) {
// do nothing
}
I tried adding querydsl-spatial to both the project and maven plugin classpath and it still isn't generating geometry expressions so I'm guessing there's likely nothing you guys can do about it.
Is there a workaround or fix for this? I have the following setup
Project Structure
pom.xml
Address
@GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
private GeoJsonPoint coordinates;
@GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
private double[] geocodes;
I've tried using both GeoJsonPoint and double[], but I still don't see support for near/distance calculations in Querydsl-based queries.
Jesse Kuhnert opened DATAMONGO-2104 and commented
The apt-maven-plugin / MongoAnnotationProcessor querydsl generation combination for spring mongo does not appear to be picking up and adding near / distance calculation support to querydsl based queries. We have a Location object nested within our Store document that looks like:
After we've run the maven plugin :
. the generated QStore.store.location.geoPoint (or the legacy double[] array coordinate) do not have any geo near methods attached as querydsl supposedly supports. The GeoJsonPoint filter generated is a SimplePath class. I've tried this using the latest querydsl dependencies for 4.2.1 release and it still doesn't pick up and recognize that I have a geo data type.
Is this an issue with the maven plugin or with the annotation processor?
Affects: 2.0.10 (Kay SR10)