diff --git a/src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java b/src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java index 5764d3505..08d8ac352 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 {@code 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 2d1758d29..8314c1d98 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 {@code 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 fb566fc4c..4205def3d 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 {@code 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 e1cd5322d..8f6abba62 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 {@code 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