diff --git a/src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java b/src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java index 5764d35050..996ed82637 100644 --- a/src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java +++ b/src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java @@ -115,6 +115,10 @@ public interface QuerydslPredicateExecutor { /** * Returns entities matching the given {@link Predicate} applying the {@link Function queryFunction} that defines the * query and its result type. + *

+ * The query object used with {@code queryFunction} is only valid inside the `findBy(…)` method call. This requires + * the query function to return a query result and not the {@link FluentQuery} object itself to ensure the query is + * executed inside the {@code findBy(…)} method. * * @param predicate must not be {@literal null}. * @param queryFunction the query function defining projection, sorting, and the result type diff --git a/src/main/java/org/springframework/data/querydsl/ReactiveQuerydslPredicateExecutor.java b/src/main/java/org/springframework/data/querydsl/ReactiveQuerydslPredicateExecutor.java index 2d1758d292..f6ab711ab0 100644 --- a/src/main/java/org/springframework/data/querydsl/ReactiveQuerydslPredicateExecutor.java +++ b/src/main/java/org/springframework/data/querydsl/ReactiveQuerydslPredicateExecutor.java @@ -136,6 +136,10 @@ public interface ReactiveQuerydslPredicateExecutor { /** * Returns entities matching the given {@link Predicate} applying the {@link Function queryFunction} that defines the * query and its result type. + *

+ * The query object used with {@code queryFunction} is only valid inside the `findBy(…)` method call. This requires + * the query function to return a query result and not the {@link FluentQuery} object itself to ensure the query is + * executed inside the {@code findBy(…)} method. * * @param predicate must not be {@literal null}. * @param queryFunction the query function defining projection, sorting, and the result type diff --git a/src/main/java/org/springframework/data/repository/query/QueryByExampleExecutor.java b/src/main/java/org/springframework/data/repository/query/QueryByExampleExecutor.java index fb566fc4c2..90e285359b 100644 --- a/src/main/java/org/springframework/data/repository/query/QueryByExampleExecutor.java +++ b/src/main/java/org/springframework/data/repository/query/QueryByExampleExecutor.java @@ -95,6 +95,10 @@ public interface QueryByExampleExecutor { /** * Returns entities matching the given {@link Example} applying the {@link Function queryFunction} that defines the * query and its result type. + *

+ * The query object used with {@code queryFunction} is only valid inside the `findBy(…)` method call. This requires + * the query function to return a query result and not the {@link FluentQuery} object itself to ensure the query is + * executed inside the {@code findBy(…)} method. * * @param example must not be {@literal null}. * @param queryFunction the query function defining projection, sorting, and the result type diff --git a/src/main/java/org/springframework/data/repository/query/ReactiveQueryByExampleExecutor.java b/src/main/java/org/springframework/data/repository/query/ReactiveQueryByExampleExecutor.java index e1cd5322d8..631e641062 100644 --- a/src/main/java/org/springframework/data/repository/query/ReactiveQueryByExampleExecutor.java +++ b/src/main/java/org/springframework/data/repository/query/ReactiveQueryByExampleExecutor.java @@ -84,6 +84,10 @@ public interface ReactiveQueryByExampleExecutor { /** * Returns entities matching the given {@link Example} applying the {@link Function queryFunction} that defines the * query and its result type. + *

+ * The query object used with {@code queryFunction} is only valid inside the `findBy(…)` method call. This requires + * the query function to return a query result and not the {@link FluentQuery} object itself to ensure the query is + * executed inside the {@code findBy(…)} method. * * @param example must not be {@literal null}. * @param queryFunction the query function defining projection, sorting, and the result type