querydsl/querydsl — pull request #1011 by steventhomson (2014-10-24 17:40:44+00:00)
Title: I692 jts geometry

## Changes
* Added JTS Geometries support.
* Now `querydsl-spatial` can be used with `hibernate-spatial` version **4.3**.

## Configuration
Maven pom snippet for brevity ...
```xml
...

org.springframework.data
spring-data-jpa
1.7.0.RELEASE

com.mysema.querydsl
querydsl-apt
3.5.0.BUILD-SNAPSHOT

com.mysema.querydsl
querydsl-jpa
3.5.0.BUILD-SNAPSHOT

com.mysema.querydsl
querydsl-spatial
3.5.0.BUILD-SNAPSHOT

org.hibernate
hibernate-entitymanager
4.3.6.Final

org.hibernate
hibernate-spatial
4.3

...

...

com.mysema.maven
apt-maven-plugin
${maven.apt.plugin}

generate-sources

process

target/generated-sources/java
com.mysema.query.apt.jpa.JPAAnnotationProcessor

...

```

## Example

Entity
```java
...

import com.vividsolutions.jts.geom.Geometry;

...

@Entity
public class Entity {

...

// The @Type annotation is Hibernate specific, and the only non-JPA annotation that is required.
@Type(type = "org.hibernate.spatial.GeometryType")
private Geometry geometry;

...

}
```
`Predicate` for use with Spring's `QueryDslPredicateExecutor`
```java
...
public static Predicate spatialWithin(Geometry geometry) {
return QEntity.entity.geometry.within(geometry);
}
...
```