接口 SpecificationQueryService<M,E>
-
- 所有已知实现类:
CrudBaseService
public interface SpecificationQueryService<M,E>
-
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default longcount(org.springframework.data.jpa.domain.Specification<E> spec)Returns the number of instances that the givenSpecificationwill return.default java.util.List<M>findAll(org.springframework.data.jpa.domain.Specification<E> spec)Returns all entities matching the givenSpecification.default org.springframework.data.domain.Page<M>findAll(org.springframework.data.jpa.domain.Specification<E> spec, org.springframework.data.domain.Pageable pageable)Returns aPageof entities matching the givenSpecification.default java.util.List<M>findAll(org.springframework.data.jpa.domain.Specification<E> spec, org.springframework.data.domain.Sort sort)Returns all entities matching the givenSpecificationandSort.default java.util.Optional<M>findOne(org.springframework.data.jpa.domain.Specification<E> spec)Returns a single entity matching the givenSpecificationorOptional.empty()if none found.<MAPPER extends EntityMapper<M,E>>
MAPPERgetEntityMapper()<REPO extends org.springframework.data.jpa.repository.JpaSpecificationExecutor<E>>
REPOgetRepository()
-
-
-
方法详细资料
-
getRepository
<REPO extends org.springframework.data.jpa.repository.JpaSpecificationExecutor<E>> REPO getRepository()
-
getEntityMapper
<MAPPER extends EntityMapper<M,E>> MAPPER getEntityMapper()
-
findOne
default java.util.Optional<M> findOne(@Nullable org.springframework.data.jpa.domain.Specification<E> spec)
Returns a single entity matching the givenSpecificationorOptional.empty()if none found.- 参数:
spec- can be null.- 返回:
- never null.
- 抛出:
org.springframework.dao.IncorrectResultSizeDataAccessException- if more than one entity found.
-
findAll
default java.util.List<M> findAll(@Nullable org.springframework.data.jpa.domain.Specification<E> spec)
Returns all entities matching the givenSpecification.- 参数:
spec- can be null.- 返回:
- never null.
-
findAll
default org.springframework.data.domain.Page<M> findAll(@Nullable org.springframework.data.jpa.domain.Specification<E> spec, org.springframework.data.domain.Pageable pageable)
Returns aPageof entities matching the givenSpecification.- 参数:
spec- can be null.pageable- must not be null.- 返回:
- never null.
-
findAll
default java.util.List<M> findAll(@Nullable org.springframework.data.jpa.domain.Specification<E> spec, org.springframework.data.domain.Sort sort)
Returns all entities matching the givenSpecificationandSort.- 参数:
spec- can be null.sort- must not be null.- 返回:
- never null.
-
count
default long count(@Nullable org.springframework.data.jpa.domain.Specification<E> spec)Returns the number of instances that the givenSpecificationwill return.- 参数:
spec- theSpecificationto count instances for. Can be null.- 返回:
- the number of instances.
-
-