Revert nullability changes in reactive transaction support
After further consideration, we have decided to revert the nullability changes in the reactive TransactionCallback and TransactionalOperator. See gh-35561
This commit is contained in:
parent
1e83de072c
commit
c08610ee58
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.springframework.transaction.reactive;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.reactivestreams.Publisher;
|
||||
|
||||
import org.springframework.transaction.ReactiveTransaction;
|
||||
|
@ -37,7 +36,7 @@ import org.springframework.transaction.ReactiveTransaction;
|
|||
* @see TransactionalOperator
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface TransactionCallback<T extends @Nullable Object> {
|
||||
public interface TransactionCallback<T> {
|
||||
|
||||
/**
|
||||
* Gets called by {@link TransactionalOperator} within a transactional context.
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.springframework.transaction.reactive;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
|
@ -60,7 +59,7 @@ public interface TransactionalOperator {
|
|||
* @throws TransactionException in case of initialization, rollback, or system errors
|
||||
* @throws RuntimeException if thrown by the TransactionCallback
|
||||
*/
|
||||
default <T extends @Nullable Object> Flux<T> transactional(Flux<T> flux) {
|
||||
default <T> Flux<T> transactional(Flux<T> flux) {
|
||||
return execute(it -> flux);
|
||||
}
|
||||
|
||||
|
@ -71,7 +70,7 @@ public interface TransactionalOperator {
|
|||
* @throws TransactionException in case of initialization, rollback, or system errors
|
||||
* @throws RuntimeException if thrown by the TransactionCallback
|
||||
*/
|
||||
default <T extends @Nullable Object> Mono<T> transactional(Mono<T> mono) {
|
||||
default <T> Mono<T> transactional(Mono<T> mono) {
|
||||
return execute(it -> mono).singleOrEmpty();
|
||||
}
|
||||
|
||||
|
@ -86,7 +85,7 @@ public interface TransactionalOperator {
|
|||
* @throws TransactionException in case of initialization, rollback, or system errors
|
||||
* @throws RuntimeException if thrown by the TransactionCallback
|
||||
*/
|
||||
<T extends @Nullable Object> Flux<T> execute(TransactionCallback<T> action) throws TransactionException;
|
||||
<T> Flux<T> execute(TransactionCallback<T> action) throws TransactionException;
|
||||
|
||||
|
||||
// Static builder methods
|
||||
|
|
Loading…
Reference in New Issue