Interface AsyncJpaSpecificationExecutor<T>
- Type Parameters:
T
- The entity type
public interface AsyncJpaSpecificationExecutor<T>
Interface representing async version of
JpaSpecificationExecutor
.- Since:
- 3.2
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<Long>
count
(@Nullable PredicateSpecification<T> spec) Returns the number of instances that the givenQuerySpecification
will return.@NonNull CompletableFuture<Long>
count
(@Nullable QuerySpecification<T> spec) Returns the number of instances that the givenQuerySpecification
will return.@NonNull CompletableFuture<Long>
deleteAll
(@Nullable DeleteSpecification<T> spec) Deletes all entities matching the givenDeleteSpecification
.@NonNull CompletableFuture<Long>
deleteAll
(@Nullable PredicateSpecification<T> spec) Deletes all entities matching the givenPredicateSpecification
.@NonNull CompletableFuture<Boolean>
exists
(@Nullable PredicateSpecification<T> spec) Returns whether an instance was found for the givenPredicateSpecification
.@NonNull CompletableFuture<Boolean>
exists
(@Nullable QuerySpecification<T> spec) Returns whether an instance was found for the givenQuerySpecification
.<S extends T>
@NonNull CompletableFuture<? extends List<S>>findAll
(@Nullable PredicateSpecification<T> spec) Returns all entities matching the givenPredicateSpecification
.@NonNull CompletableFuture<Page<T>>
findAll
(@Nullable PredicateSpecification<T> spec, Pageable pageable) Returns aPage
of entities matching the givenPredicateSpecification
.<S extends T>
@NonNull CompletableFuture<? extends List<S>>findAll
(@Nullable PredicateSpecification<T> spec, Sort sort) Returns all entities matching the givenQuerySpecification
andSort
.<S extends T>
@NonNull CompletableFuture<? extends List<S>>findAll
(@Nullable QuerySpecification<T> spec) Returns all entities matching the givenQuerySpecification
.@NonNull CompletableFuture<Page<T>>
findAll
(@Nullable QuerySpecification<T> spec, Pageable pageable) Returns aPage
of entities matching the givenQuerySpecification
.<S extends T>
@NonNull CompletableFuture<? extends List<S>>findAll
(@Nullable QuerySpecification<T> spec, Sort sort) Returns all entities matching the givenQuerySpecification
andSort
.<S extends T>
@NonNull CompletableFuture<S>findOne
(@Nullable PredicateSpecification<T> spec) Returns a single entity matching the givenPredicateSpecification
.<S extends T>
@NonNull CompletableFuture<S>findOne
(@Nullable QuerySpecification<T> spec) Returns a single entity matching the givenQuerySpecification
.@NonNull CompletableFuture<Long>
updateAll
(@Nullable UpdateSpecification<T> spec) Updates all entities matching the givenUpdateSpecification
.
-
Method Details
-
findOne
@NonNull <S extends T> @NonNull CompletableFuture<S> findOne(@Nullable @Nullable QuerySpecification<T> spec) Returns a single entity matching the givenQuerySpecification
.- Type Parameters:
S
- The entity type- Parameters:
spec
- The query specification- Returns:
- optional found result
-
findOne
@NonNull <S extends T> @NonNull CompletableFuture<S> findOne(@Nullable @Nullable PredicateSpecification<T> spec) Returns a single entity matching the givenPredicateSpecification
.- Type Parameters:
S
- The result type- Parameters:
spec
- The query specification- Returns:
- optional found result
-
findAll
@NonNull <S extends T> @NonNull CompletableFuture<? extends List<S>> findAll(@Nullable @Nullable QuerySpecification<T> spec) Returns all entities matching the givenQuerySpecification
.- Type Parameters:
S
- The result type- Parameters:
spec
- The query specification- Returns:
- found results
-
findAll
@NonNull <S extends T> @NonNull CompletableFuture<? extends List<S>> findAll(@Nullable @Nullable PredicateSpecification<T> spec) Returns all entities matching the givenPredicateSpecification
.- Type Parameters:
S
- The result type- Parameters:
spec
- The query specification- Returns:
- found results
-
findAll
@NonNull @NonNull CompletableFuture<Page<T>> findAll(@Nullable @Nullable QuerySpecification<T> spec, Pageable pageable) Returns aPage
of entities matching the givenQuerySpecification
.- Parameters:
spec
- The query specificationpageable
- The pageable object- Returns:
- a page
-
findAll
@NonNull @NonNull CompletableFuture<Page<T>> findAll(@Nullable @Nullable PredicateSpecification<T> spec, Pageable pageable) Returns aPage
of entities matching the givenPredicateSpecification
.- Parameters:
spec
- The query specificationpageable
- The pageable object- Returns:
- a page
-
findAll
@NonNull <S extends T> @NonNull CompletableFuture<? extends List<S>> findAll(@Nullable @Nullable QuerySpecification<T> spec, Sort sort) Returns all entities matching the givenQuerySpecification
andSort
.- Type Parameters:
S
- The result type- Parameters:
spec
- The query specificationsort
- The sort object- Returns:
- found results
-
findAll
@NonNull <S extends T> @NonNull CompletableFuture<? extends List<S>> findAll(@Nullable @Nullable PredicateSpecification<T> spec, Sort sort) Returns all entities matching the givenQuerySpecification
andSort
.- Type Parameters:
S
- The result type- Parameters:
spec
- The query specificationsort
- The sort object- Returns:
- found results
-
count
Returns the number of instances that the givenQuerySpecification
will return.- Parameters:
spec
- The query specification- Returns:
- the number of instances.
-
count
Returns the number of instances that the givenQuerySpecification
will return.- Parameters:
spec
- The query specification- Returns:
- the number of instances.
-
exists
Returns whether an instance was found for the givenQuerySpecification
.- Parameters:
spec
- The query specification- Returns:
- the number of instances.
- Since:
- 3.8
-
exists
@NonNull @NonNull CompletableFuture<Boolean> exists(@Nullable @Nullable PredicateSpecification<T> spec) Returns whether an instance was found for the givenPredicateSpecification
.- Parameters:
spec
- The query specification- Returns:
- the number of instances.
- Since:
- 3.8
-
deleteAll
@NonNull @NonNull CompletableFuture<Long> deleteAll(@Nullable @Nullable DeleteSpecification<T> spec) Deletes all entities matching the givenDeleteSpecification
.- Parameters:
spec
- The delete specification- Returns:
- the number records deleted.
-
deleteAll
@NonNull @NonNull CompletableFuture<Long> deleteAll(@Nullable @Nullable PredicateSpecification<T> spec) Deletes all entities matching the givenPredicateSpecification
.- Parameters:
spec
- The delete specification- Returns:
- the number records deleted.
-
updateAll
@NonNull @NonNull CompletableFuture<Long> updateAll(@Nullable @Nullable UpdateSpecification<T> spec) Updates all entities matching the givenUpdateSpecification
.- Parameters:
spec
- The update specification- Returns:
- the number records updated.
-