Skip to content

Commit b751bdd

Browse files
authored
Update QueryDSL doc. (#1994)
Closes #1993.
1 parent bc0c757 commit b751bdd

File tree

1 file changed

+43
-20
lines changed

1 file changed

+43
-20
lines changed

src/main/antora/modules/ROOT/pages/couchbase/repository.adoc

+43-20
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,47 @@ An advanced usage is described in <<couchbase.repository.multibucket>>.
3333

3434
[[couchbase.repository.configuration.dsl]]
3535
=== QueryDSL Configuration
36-
Spring Data Couchbase supports QueryDSL for building type-safe queries. To enable code generation you need to set `spring-data-couchbase` as annotation processor on your project.
36+
Spring Data Couchbase supports QueryDSL for building type-safe queries. To enable code generation, setting `CouchbaseAnnotationProcessor` as an annotation processor is required.
37+
Additionally, the runtime needs querydsl-apt to enable QueryDSL on repositories.
3738

3839
.Maven Configuration Example
3940
====
4041
[source,xml]
4142
----
43+
. existing depdendencies including those required for spring-data-couchbase
44+
.
45+
.
46+
<dependency>
47+
<groupId>com.querydsl</groupId>
48+
<artifactId>querydsl-apt</artifactId>
49+
<version>${querydslVersion}</version>
50+
</dependency>
51+
</dependencies>
52+
4253
<build>
4354
<plugins>
4455
<plugin>
4556
<groupId>org.apache.maven.plugins</groupId>
4657
<artifactId>maven-compiler-plugin</artifactId>
47-
<version>[compiler-plugin-version]</version>
48-
<configuration>
49-
<annotationProcessorPaths>
50-
<!-- path to the annotation processor -->
51-
<path>
52-
<groupId>com.querydsl</groupId>
53-
<artifactId>querydsl-apt</artifactId>
54-
<version>[version]</version>
55-
</path>
56-
<path>
57-
<groupId>org.springframework.data</groupId>
58-
<artifactId>spring-data-couchbase</artifactId>
59-
<version>[version]</version>
60-
</path>
61-
</annotationProcessorPaths>
62-
</configuration>
58+
<executions>
59+
<execution>
60+
<id>annotation-processing</id>
61+
<phase>generate-sources</phase>
62+
<goals>
63+
<goal>compile</goal>
64+
</goals>
65+
<configuration>
66+
<proc>only</proc>
67+
<annotationProcessors>
68+
<annotationProcessor>org.springframework.data.couchbase.repository.support.CouchbaseAnnotationProcessor</annotationProcessor>
69+
</annotationProcessors>
70+
<generatedTestSourcesDirectory>target/generated-sources</generatedTestSourcesDirectory>
71+
<compilerArgs>
72+
<arg>-Aquerydsl.logInfo=true</arg>
73+
</compilerArgs>
74+
</configuration>
75+
</execution>
76+
</executions>
6377
</plugin>
6478
</plugins>
6579
</build>
@@ -69,10 +83,19 @@ Spring Data Couchbase supports QueryDSL for building type-safe queries. To enabl
6983

7084
.Gradle Configuration Example
7185
====
72-
[source,groovy]
86+
[source,groovy,indent=0,subs="verbatim,quotes",role="secondary"]
7387
----
74-
annotationProcessor 'com.querydsl:querydsl-apt:${querydslVersion}'
75-
annotationProcessor 'org.springframework.data:spring-data-couchbase:${springDataCouchbaseVersion}'
88+
dependencies {
89+
annotationProcessor 'com.querydsl:querydsl-apt:${querydslVersion}'
90+
annotationProcessor 'org.springframework.data:spring-data-couchbase'
91+
testAnnotationProcessor 'com.querydsl:querydsl-apt:${querydslVersion}'
92+
testAnnotationProcessor 'org.springframework.data:spring-data-couchbase'
93+
}
94+
tasks.withType(JavaCompile).configureEach {
95+
options.compilerArgs += [
96+
"-processor",
97+
"org.springframework.data.couchbase.repository.support.CouchbaseAnnotationProcessor"]
98+
}
7699
----
77100
====
78101

0 commit comments

Comments
 (0)