接口 SpecificationQueryService<M,​E>

  • 所有已知实现类:
    CrudBaseService

    public interface SpecificationQueryService<M,​E>
    • 方法概要

      所有方法 实例方法 抽象方法 默认方法 
      修饰符和类型 方法 说明
      default long count​(org.springframework.data.jpa.domain.Specification<E> spec)
      Returns the number of instances that the given Specification will return.
      default java.util.List<M> findAll​(org.springframework.data.jpa.domain.Specification<E> spec)
      Returns all entities matching the given Specification.
      default org.springframework.data.domain.Page<M> findAll​(org.springframework.data.jpa.domain.Specification<E> spec, org.springframework.data.domain.Pageable pageable)
      Returns a Page of entities matching the given Specification.
      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 given Specification and Sort.
      default java.util.Optional<M> findOne​(org.springframework.data.jpa.domain.Specification<E> spec)
      Returns a single entity matching the given Specification or Optional.empty() if none found.
      <MAPPER extends EntityMapper<M,​E>>
      MAPPER
      getEntityMapper()  
      <REPO extends org.springframework.data.jpa.repository.JpaSpecificationExecutor<E>>
      REPO
      getRepository()  
    • 方法详细资料

      • 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 given Specification or Optional.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 given Specification.
        参数:
        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 a Page of entities matching the given Specification.
        参数:
        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 given Specification and Sort.
        参数:
        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 given Specification will return.
        参数:
        spec - the Specification to count instances for. Can be null.
        返回:
        the number of instances.