diff --git a/pom.xml b/pom.xml
index bdb8301a0..76bf84460 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,6 +26,7 @@
2.10.13
2.13.4
4.0.0
+ 6.11
@@ -43,10 +44,12 @@
+
+ io.github.openfeign.querydsl
querydsl-apt
- ${querydsl}
- jakarta
+ ${querydsl_of}
provided
diff --git a/src/test/java/org/springframework/data/couchbase/repository/query/CouchbaseRepositoryQuerydslIntegrationTests.java b/src/test/java/org/springframework/data/couchbase/repository/query/CouchbaseRepositoryQuerydslIntegrationTests.java
index 600b0cb19..d4dca5cb3 100644
--- a/src/test/java/org/springframework/data/couchbase/repository/query/CouchbaseRepositoryQuerydslIntegrationTests.java
+++ b/src/test/java/org/springframework/data/couchbase/repository/query/CouchbaseRepositoryQuerydslIntegrationTests.java
@@ -20,6 +20,7 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.springframework.data.couchbase.util.Util.comprises;
import static org.springframework.data.couchbase.util.Util.exactly;
@@ -29,6 +30,7 @@
import java.util.Optional;
import java.util.stream.StreamSupport;
+import com.querydsl.core.types.dsl.PathBuilder;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
@@ -43,8 +45,10 @@
import org.springframework.data.couchbase.core.mapping.event.ValidatingCouchbaseEventListener;
import org.springframework.data.couchbase.core.query.QueryCriteriaDefinition;
import org.springframework.data.couchbase.domain.Airline;
+import org.springframework.data.couchbase.domain.AirlineCollectioned;
import org.springframework.data.couchbase.domain.AirlineRepository;
import org.springframework.data.couchbase.domain.QAirline;
+import org.springframework.data.couchbase.domain.QAirlineCollectioned;
import org.springframework.data.couchbase.repository.auditing.EnableCouchbaseAuditing;
import org.springframework.data.couchbase.repository.auditing.EnableReactiveCouchbaseAuditing;
import org.springframework.data.couchbase.repository.config.EnableCouchbaseRepositories;
@@ -147,6 +151,13 @@ void testEq() {
}
}
+ @Test
+ void testInjection() {
+ String userSpecifiedPath = "1 = 1) OR (2";
+ PathBuilder pathBuilder = new PathBuilder<>(QAirline.class, "xyz");
+ assertThrows(IllegalStateException.class, () -> pathBuilder.get(userSpecifiedPath).eq("2"));
+ }
+
// this gives hqCountry == "" and hqCountry is missing
// @Test
void testStringIsEmpty() {