Package org.hibernate.reactive.util.impl
Class CompletionStages.Completable<T>
java.lang.Object
org.hibernate.reactive.util.impl.CompletionStages.Completable<T>
- Enclosing class:
- CompletionStages
Makes the code simpler when dealing with ORM visitor pattern.
For example:
private CompletionStage<Void> visitConstraintOrderedTables(QuerySpec idTableIdentifierSubQuery, ExecutionContext executionContext) {
final Completable<Integer> completable = new Completable<>();
entityDescriptor
.visitConstraintOrderedTables( (tableExpression, tableKeyColumnVisitationSupplier) -> deleteFromTableUsingIdTable(
tableExpression,
tableKeyColumnVisitationSupplier,
idTableIdentifierSubQuery,
executionContext
)
.handle( completable::complete )
);
return completable.getStage().thenCompose( CompletionStages::voidFuture );
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIt will complete the underlyingCompletionStagebased on the parameters.getStage()
-
Constructor Details
-
Completable
public Completable()
-
-
Method Details
-
complete
It will complete the underlyingCompletionStagebased on the parameters.- Returns:
null- See Also:
-
getStage
- Returns:
- a
CompletionStagethat will complete (successfully or exceptionally) aftercomplete(Object, Throwable)gets called
-