Document that fluent findBy(…) queries must return a result.

Closes #3294
This commit is contained in:
Mark Paluch
2025-01-22 14:15:39 +01:00
parent 65d0c51d4d
commit e6c2008e8e

View File

@@ -217,6 +217,10 @@ public interface JpaSpecificationExecutor<T> {
/**
* Returns entities matching the given {@link Specification} applying the {@code queryFunction} that defines the query
* and its result type.
* <p>
* 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 spec must not be null.
* @param queryFunction the query function defining projection, sorting, and the result type