Package io.micronaut.data.jpa.repository
Interface JpaSpecificationExecutor<T>
- Type Parameters:
- T- The entity type
public interface JpaSpecificationExecutor<T>
Interface to allow execution of 
Specifications based on the JPA criteria API.
 Note: Forked from 'org.springframework.data.jpa.repository.JpaSpecificationExecutor'.- Since:
- 3.1
- Author:
- Oliver Gierke, Christoph Strobl
- 
Method SummaryModifier and TypeMethodDescriptionlongcount(@Nullable Specification<T> spec) Returns the number of instances that the givenSpecificationwill return.findAll(@Nullable Specification<T> spec) Returns all entities matching the givenSpecification.findAll(@Nullable Specification<T> spec, Pageable pageable) Returns aPageof entities matching the givenSpecification.findAll(@Nullable Specification<T> spec, Sort sort) Returns all entities matching the givenSpecificationandSort.findOne(@Nullable Specification<T> spec) Returns a single entity matching the givenSpecificationorOptional.empty()if none found.
- 
Method Details- 
findOneReturns a single entity matching the givenSpecificationorOptional.empty()if none found.- Parameters:
- spec- can be null.
- Returns:
- never null.
 
- 
findAllReturns all entities matching the givenSpecification.- Parameters:
- spec- can be null.
- Returns:
- never null.
 
- 
findAllReturns aPageof entities matching the givenSpecification.- Parameters:
- spec- can be null.
- pageable- must not be null.
- Returns:
- never null.
 
- 
findAllReturns all entities matching the givenSpecificationandSort.- Parameters:
- spec- can be null.
- sort- must not be null.
- Returns:
- never null.
 
- 
countReturns the number of instances that the givenSpecificationwill return.- Parameters:
- spec- the- Specificationto count instances for. Can be null.
- Returns:
- the number of instances.
 
 
-