Skip to content

Commit ca60e38

Browse files
committed
Document that fluent findBy(…) queries must return a result.
Closes #3294
1 parent 422598b commit ca60e38

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/JpaSpecificationExecutor.java

+4
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ default long delete(PredicateSpecification<T> spec) {
217217
/**
218218
* Returns entities matching the given {@link Specification} applying the {@code queryFunction} that defines the query
219219
* and its result type.
220+
* <p>
221+
* The query object used with {@code queryFunction} is only valid inside the {@code findBy(…)} method call. This
222+
* requires the query function to return a query result and not the {@link FluentQuery} object itself to ensure the
223+
* query is executed inside the {@code findBy(…)} method.
220224
*
221225
* @param spec must not be null.
222226
* @param queryFunction the query function defining projection, sorting, and the result type

0 commit comments

Comments
 (0)