DATADOC-115 - Upgraded to Querydsl 2.2.0-beta4.

Enabled treatment of not annotated classes as embedded documents to let Querydsl create query classes for them. Annotated BasePerson with @QuerySupertype as Querydsl seems to need this annotation to create the query class for super types in the 2.2 branch.

That issue is tracked in https://bugs.launchpad.net/querydsl/+bug/776219 so that we should be able to remove the annotation as soon as this one is fixed.
This commit is contained in:
Oliver Gierke
2011-05-03 10:34:04 +02:00
parent 68f8bd62d1
commit 7f6a6094e6
3 changed files with 13 additions and 4 deletions

View File

@@ -14,6 +14,7 @@
<properties>
<mongo.version>2.4</mongo.version>
<querydsl.version>2.2.0-beta4</querydsl.version>
</properties>
<dependencies>
@@ -65,7 +66,7 @@
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-mongodb</artifactId>
<version>2.1.1</version>
<version>${querydsl.version}</version>
<optional>true</optional>
<exclusions>
<exclusion>
@@ -78,7 +79,7 @@
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>2.1.1</version>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
@@ -161,7 +162,7 @@
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0</version>
<version>1.0.1</version>
<executions>
<execution>
<phase>generate-test-sources</phase>
@@ -169,7 +170,7 @@
<goal>test-process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/test-annotations</outputDirectory>
<outputDirectory>target/generated-test-sources</outputDirectory>
<processor>org.springframework.data.document.mongodb.repository.MongoAnnotationProcessor</processor>
</configuration>
</execution>

View File

@@ -56,6 +56,7 @@ public class MongoAnnotationProcessor extends AbstractProcessor {
DefaultConfiguration configuration = new DefaultConfiguration(roundEnv, processingEnv.getOptions(),
Collections.<String> emptySet(), QueryEntities.class, Document.class, QuerySupertype.class,
QueryEmbeddable.class, QueryEmbedded.class, QueryTransient.class);
configuration.setUnknownAsEmbedded(true);
Processor processor = new Processor(processingEnv, roundEnv, configuration);
processor.process();

View File

@@ -16,9 +16,16 @@
package org.springframework.data.document.mongodb.mapping;
import com.mysema.query.annotations.QuerySupertype;
/**
* {@link QuerySupertype} is necessary for Querydsl 2.2.0-beta4 to compile the query classes directly. Can be removed as
* soon as {@link https://bugs.launchpad.net/querydsl/+bug/776219} is fixed.
*
* @see https://bugs.launchpad.net/querydsl/+bug/776219
* @author Jon Brisbin <jbrisbin@vmware.com>
*/
@QuerySupertype
public abstract class BasePerson {
protected Integer ssn;