Skip to content

Commit f082922

Browse files
committed
Add missing @Nullable annotations to QueryByExampleExecutor.findBy(…) and QuerydslPredicateExecutor.findBy(…).
Closes #3346
1 parent f43e372 commit f082922

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/org/springframework/data/querydsl/QuerydslPredicateExecutor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import java.util.Optional;
1919
import java.util.function.Function;
2020

21+
import org.jspecify.annotations.Nullable;
22+
2123
import org.springframework.data.domain.Page;
2224
import org.springframework.data.domain.Pageable;
2325
import org.springframework.data.domain.Sort;
@@ -125,5 +127,6 @@ public interface QuerydslPredicateExecutor<T> {
125127
* @return all entities matching the given {@link Predicate}.
126128
* @since 2.6
127129
*/
128-
<S extends T, R> R findBy(Predicate predicate, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction);
130+
<S extends T, R extends @Nullable Object> R findBy(Predicate predicate,
131+
Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction);
129132
}

src/main/java/org/springframework/data/repository/query/QueryByExampleExecutor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import java.util.Optional;
1919
import java.util.function.Function;
2020

21+
import org.jspecify.annotations.Nullable;
22+
2123
import org.springframework.data.domain.Example;
2224
import org.springframework.data.domain.Page;
2325
import org.springframework.data.domain.Pageable;
@@ -105,5 +107,6 @@ public interface QueryByExampleExecutor<T> {
105107
* @return all entities matching the given {@link Example}.
106108
* @since 2.6
107109
*/
108-
<S extends T, R> R findBy(Example<S> example, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction);
110+
<S extends T, R extends @Nullable Object> R findBy(Example<S> example,
111+
Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction);
109112
}

0 commit comments

Comments
 (0)