Added support auto generating Q classes for QueryDSL

This commit is contained in:
coach88 2015-08-07 13:45:11 +03:00
parent 686769e99d
commit 56cba00c7d
3 changed files with 22 additions and 26 deletions

View File

@ -71,18 +71,31 @@
<artifactId>querydsl-mongodb</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>3.6.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>org.springframework.data.mongodb.repository.support.MongoAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -1,20 +0,0 @@
package org.baeldung.model;
import javax.annotation.Generated;
import com.mysema.query.types.path.EntityPathBase;
import com.mysema.query.types.path.StringPath;
@Generated("com.mysema.query.codegen.EntitySerializer")
public class QUser extends EntityPathBase<User> {
private static final long serialVersionUID = 1L;
public static final QUser user = new QUser("user");
public final StringPath name = createString("name");
public QUser(String variable) {
super(User.class, variable);
}
}

View File

@ -3,6 +3,9 @@ package org.baeldung.model;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import com.mysema.query.annotations.QueryEntity;
@QueryEntity
@Document
public class User {