Package io.micronaut.data.operations
Interface CriteriaRepositoryOperations
- All Known Subinterfaces:
BlockingCriteriaCapableRepository
,BlockingReactorCriteriaRepositoryOperations
public interface CriteriaRepositoryOperations
The repository operations that support executing criteria queries.
- Since:
- 4.5.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionExecutes delete for the given query and parameter values.boolean
exists
(@NonNull jakarta.persistence.criteria.CriteriaQuery<?> query) Exists query.<T> @NonNull List<T>
findAll
(@NonNull jakarta.persistence.criteria.CriteriaQuery<T> query) Finds all results for the given query.<T> @NonNull List<T>
findAll
(@NonNull jakarta.persistence.criteria.CriteriaQuery<T> query, int offset, int limit) Finds all results for the given query.<R> R
findOne
(@NonNull jakarta.persistence.criteria.CriteriaQuery<R> query) Find one by Query.jakarta.persistence.criteria.CriteriaBuilder
Executes an update for the given query and parameter values.
-
Method Details
-
getCriteriaBuilder
jakarta.persistence.criteria.CriteriaBuilder getCriteriaBuilder()- Returns:
- The criteria builder
-
exists
boolean exists(@NonNull @NonNull jakarta.persistence.criteria.CriteriaQuery<?> query) Exists query.- Parameters:
query
- The query- Returns:
- True if query returns true or any row
- Since:
- 4.10
-
findOne
@Nullable <R> R findOne(@NonNull @NonNull jakarta.persistence.criteria.CriteriaQuery<R> query) Find one by Query.- Type Parameters:
R
- The result type- Parameters:
query
- The query- Returns:
- A result or null
-
findAll
@NonNull <T> @NonNull List<T> findAll(@NonNull @NonNull jakarta.persistence.criteria.CriteriaQuery<T> query) Finds all results for the given query.- Type Parameters:
T
- The generic type- Parameters:
query
- The query- Returns:
- An iterable result
-
findAll
@NonNull <T> @NonNull List<T> findAll(@NonNull @NonNull jakarta.persistence.criteria.CriteriaQuery<T> query, int offset, int limit) Finds all results for the given query.- Type Parameters:
T
- The generic type- Parameters:
query
- The queryoffset
- The offsetlimit
- The limit- Returns:
- An iterable result
-
updateAll
@NonNull @NonNull Optional<Number> updateAll(@NonNull @NonNull jakarta.persistence.criteria.CriteriaUpdate<Number> query) Executes an update for the given query and parameter values. If it is possible to return the number of objects updated, then do so.- Parameters:
query
- The prepared query- Returns:
- An optional number with the count of the number of records updated
-
deleteAll
@NonNull @NonNull Optional<Number> deleteAll(@NonNull @NonNull jakarta.persistence.criteria.CriteriaDelete<Number> query) Executes delete for the given query and parameter values. If it is possible to return the number of objects deleted, then do so.- Parameters:
query
- The query- Returns:
- An optional number with the count of the number of records updated
-