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

Closes #3237
This commit is contained in:
Mark Paluch
2025-01-22 14:11:25 +01:00
parent d197037027
commit b8950af82a
4 changed files with 16 additions and 0 deletions

View File

@@ -115,6 +115,10 @@ public interface QuerydslPredicateExecutor<T> {
/**
* Returns entities matching the given {@link Predicate} applying the {@link Function 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 predicate must not be {@literal null}.
* @param queryFunction the query function defining projection, sorting, and the result type

View File

@@ -136,6 +136,10 @@ public interface ReactiveQuerydslPredicateExecutor<T> {
/**
* Returns entities matching the given {@link Predicate} applying the {@link Function 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 predicate must not be {@literal null}.
* @param queryFunction the query function defining projection, sorting, and the result type

View File

@@ -95,6 +95,10 @@ public interface QueryByExampleExecutor<T> {
/**
* Returns entities matching the given {@link Example} applying the {@link Function 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 example must not be {@literal null}.
* @param queryFunction the query function defining projection, sorting, and the result type

View File

@@ -84,6 +84,10 @@ public interface ReactiveQueryByExampleExecutor<T> {
/**
* Returns entities matching the given {@link Example} applying the {@link Function 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 example must not be {@literal null}.
* @param queryFunction the query function defining projection, sorting, and the result type