Interface FluentQuery.FetchableFluentQuery<T>

All Superinterfaces:
FluentQuery<T>
Enclosing interface:
FluentQuery<T>

public static interface FluentQuery.FetchableFluentQuery<T> extends FluentQuery<T>
Fetchable extension FluentQuery allowing to materialize results from the underlying query.
Since:
2.6
Author:
Mark Paluch
  • Method Details

    • sortBy

      Description copied from interface: FluentQuery
      Define the sort order.
      Specified by:
      sortBy in interface FluentQuery<T>
      Parameters:
      sort - the Sort specification to sort the results by, may be Sort.unsorted(), must not be null.
      Returns:
      a new instance of FluentQuery.
    • limit

      default FluentQuery.FetchableFluentQuery<T> limit(int limit)
      Description copied from interface: FluentQuery
      Define the query limit.
      Specified by:
      limit in interface FluentQuery<T>
      Parameters:
      limit - the limit to apply to the query to limit results. Must not be negative.
      Returns:
      a new instance of FluentQuery.
    • as

      <R> FluentQuery.FetchableFluentQuery<R> as(Class<R> resultType)
      Description copied from interface: FluentQuery
      Define the target type the result should be mapped to. Skip this step if you are only interested in the original domain type.
      Specified by:
      as in interface FluentQuery<T>
      Type Parameters:
      R - result type.
      Parameters:
      resultType - must not be null.
      Returns:
      a new instance of FluentQuery.
    • project

      default FluentQuery.FetchableFluentQuery<T> project(String... properties)
      Description copied from interface: FluentQuery
      Define which properties or property paths to include in the query.
      Specified by:
      project in interface FluentQuery<T>
      Parameters:
      properties - must not be null.
      Returns:
      a new instance of FluentQuery.
    • project

      Description copied from interface: FluentQuery
      Define which properties or property paths to include in the query.
      Specified by:
      project in interface FluentQuery<T>
      Parameters:
      properties - must not be null.
      Returns:
      a new instance of FluentQuery.
    • one

      default Optional<T> one()
      Get exactly zero or one result.
      Returns:
      Optional.empty() if no match found.
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if more than one match found.
    • oneValue

      @Nullable T oneValue()
      Get exactly zero or one result.
      Returns:
      null if no match found.
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if more than one match found.
    • first

      default Optional<T> first()
      Get the first or no result.
      Returns:
      Optional.empty() if no match found.
    • firstValue

      @Nullable T firstValue()
      Get the first or no result.
      Returns:
      null if no match found.
    • all

      List<T> all()
      Get all matching elements.
      Returns:
    • scroll

      default Window<T> scroll(ScrollPosition scrollPosition)
      Get all matching elements as Window to start result scrolling or resume scrolling at scrollPosition.
      Parameters:
      scrollPosition - must not be null.
      Returns:
      Throws:
      IllegalArgumentException - if scrollPosition is null.
      UnsupportedOperationException - if not supported by the underlying implementation.
      Since:
      3.1
    • page

      Page<T> page(Pageable pageable)
      Get a page of matching elements for Pageable.
      Parameters:
      pageable - the pageable to request a paged result, can be Pageable.unpaged(), must not be null. The given Pageable will override any previously specified sort if the Sort object is not Sort.isUnsorted(). Any potentially specified limit(int) will be overridden by Pageable.getPageSize().
      Returns:
    • stream

      Stream<T> stream()
      Stream all matching elements.
      Returns:
      a Stream wrapping cursors that need to be closed.
    • count

      long count()
      Get the number of matching elements.
      Returns:
      total number of matching elements.
    • exists

      boolean exists()
      Check for the presence of matching elements.
      Returns:
      true if at least one matching element exists.