Interface RootStream<X>

All Superinterfaces:
ExprStream<X,jakarta.persistence.criteria.Root<X>>, FromStream<X,jakarta.persistence.criteria.Root<X>>, PathStream<X,jakarta.persistence.criteria.Root<X>>, QueryConfigurer<jakarta.persistence.criteria.AbstractQuery<?>,X,jakarta.persistence.criteria.Root<X>>, QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>, SearchStream<X,jakarta.persistence.criteria.Root<X>>
All Known Subinterfaces:
RootValue<X>

public interface RootStream<X> extends FromStream<X,jakarta.persistence.criteria.Root<X>>
SearchStream containing items representable as Roots.
  • Method Details

    • cast

      <Y extends X> RootStream<Y> cast(Class<Y> type)
      Description copied from interface: PathStream
      Map this stream into a stream whose elements are the result of applying the given narrowing cast.
      Specified by:
      cast in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Type Parameters:
      Y - narrower type
      Parameters:
      type - new, narrower item type
      Returns:
      recast stream
      See Also:
      • CriteriaBuilder.treat()
    • distinct

      RootStream<X> distinct()
      Description copied from interface: SearchStream
      Suppress duplicates.
      Specified by:
      distinct in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      distinct in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      distinct in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      distinct in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Returns:
      a new stream with duplicates removed
    • orderBy

      RootStream<X> orderBy(Ref<?,? extends jakarta.persistence.criteria.Expression<?>> ref, boolean asc)
      Description copied from interface: SearchStream
      Order results using the specified expression reference.

      Replaces any existing sort ordering.

      Specified by:
      orderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      ref - previously bound expression reference
      asc - true for ascending, false for descending
      Returns:
      a new stream with specified ordering
    • orderBy

      RootStream<X> orderBy(jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute, boolean asc)
      Description copied from interface: SearchStream
      Order results using the specified property.

      Replaces any existing sort ordering.

      Specified by:
      orderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute - associated property
      asc - true for ascending, false for descending
      Returns:
      a new stream with specified ordering
    • orderBy

      RootStream<X> orderBy(jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute1, boolean asc1, jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute2, boolean asc2)
      Description copied from interface: SearchStream
      Order results using the specified properties.

      Replaces any existing sort ordering.

      Specified by:
      orderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute1 - associated property
      asc1 - true for attribute1 ascending, false for attribute1 descending
      attribute2 - associated property
      asc2 - true for attribute2 ascending, false for attribute2 descending
      Returns:
      a new stream with specified ordering
    • orderBy

      RootStream<X> orderBy(jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute1, boolean asc1, jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute2, boolean asc2, jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute3, boolean asc3)
      Description copied from interface: SearchStream
      Order results using the specified properties.

      Replaces any existing sort ordering.

      Specified by:
      orderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute1 - associated property
      asc1 - true for attribute1 ascending, false for attribute1 descending
      attribute2 - associated property
      asc2 - true for attribute2 ascending, false for attribute2 descending
      attribute3 - associated property
      asc3 - true for attribute3 ascending, false for attribute3 descending
      Returns:
      a new stream with specified ordering
    • orderBy

      RootStream<X> orderBy(Function<? super jakarta.persistence.criteria.Root<X>,? extends jakarta.persistence.criteria.Expression<?>> orderExprFunction, boolean asc)
      Description copied from interface: SearchStream
      Order results using the Expression produced by the given Function.

      Replaces any existing sort ordering.

      Specified by:
      orderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      orderExprFunction - Function that produces an Expression to order on given an item expression
      asc - true for ascending, false for descending
      Returns:
      a new stream with specified ordering
    • orderBy

      RootStream<X> orderBy(jakarta.persistence.criteria.Order... orders)
      Description copied from interface: SearchStream
      Order results using the specified Orders.

      Replaces any existing sort ordering.

      Specified by:
      orderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      orders - ordering(s), with higher precedence orderings first
      Returns:
      a new stream with specified ordering(s)
    • orderByMulti

      RootStream<X> orderByMulti(Function<? super jakarta.persistence.criteria.Root<X>,? extends List<? extends jakarta.persistence.criteria.Order>> orderListFunction)
      Description copied from interface: SearchStream
      Order results using the Order list produced by the given Function.

      Replaces any existing sort ordering.

      Specified by:
      orderByMulti in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderByMulti in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderByMulti in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      orderByMulti in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      orderListFunction - Function that produces the sort ordering given an item expression
      Returns:
      a new stream with specified ordering
    • thenOrderBy

      RootStream<X> thenOrderBy(jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute, boolean asc)
      Description copied from interface: SearchStream
      Order results using the specified property after existing sort.

      Adds to any existing sort ordering.

      Specified by:
      thenOrderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute - associated property
      asc - true for ascending, false for descending
      Returns:
      a new stream with specified additional ordering
    • thenOrderBy

      RootStream<X> thenOrderBy(Ref<?,? extends jakarta.persistence.criteria.Expression<?>> ref, boolean asc)
      Description copied from interface: SearchStream
      Order results using the specified expression reference after existing sort.

      Adds to any existing sort ordering.

      Specified by:
      thenOrderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      ref - previously bound expression reference
      asc - true for ascending, false for descending
      Returns:
      a new stream with specified additional ordering
    • thenOrderBy

      RootStream<X> thenOrderBy(jakarta.persistence.criteria.Order... orders)
      Description copied from interface: SearchStream
      Order results using the specified Orders after existing sort.

      Adds to any existing sort ordering.

      Specified by:
      thenOrderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      orders - ordering(s), with higher precedence orderings first
      Returns:
      a new stream with specified additional ordering(s)
    • thenOrderBy

      RootStream<X> thenOrderBy(Function<? super jakarta.persistence.criteria.Root<X>,? extends jakarta.persistence.criteria.Expression<?>> orderExprFunction, boolean asc)
      Description copied from interface: SearchStream
      Order results using the Expression produced by the given Function after existing sort.

      Adds to any existing sort ordering.

      Specified by:
      thenOrderBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      thenOrderBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      orderExprFunction - Function that produces an Expression to order on given an item expression
      asc - true for ascending, false for descending
      Returns:
      a new stream with specified additional ordering
    • groupBy

      RootStream<X> groupBy(Ref<?,? extends jakarta.persistence.criteria.Expression<?>> ref)
      Description copied from interface: SearchStream
      Apply grouping based on an expression reference.

      Adds to any previously specified groupings.

      Specified by:
      groupBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      ref - previously bound expression reference
      Returns:
      a new stream with additional grouping
    • groupBy

      RootStream<X> groupBy(jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute)
      Description copied from interface: SearchStream
      Apply grouping based on the specified property.

      Adds to any previously specified groupings.

      Specified by:
      groupBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute - associated property
      Returns:
      a new stream with additional grouping
    • groupBy

      RootStream<X> groupBy(Function<? super jakarta.persistence.criteria.Root<X>,? extends jakarta.persistence.criteria.Expression<?>> groupFunction)
      Description copied from interface: SearchStream
      Apply grouping based on a single expression.

      Adds to any previously specified groupings.

      Specified by:
      groupBy in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupBy in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      groupFunction - function returning an expression by which to group results
      Returns:
      a new stream with additional grouping
    • groupByMulti

      RootStream<X> groupByMulti(Function<? super jakarta.persistence.criteria.Root<X>,? extends List<jakarta.persistence.criteria.Expression<?>>> groupFunction)
      Description copied from interface: SearchStream
      Apply grouping based on a list of expressions.

      Adds to any previously specified groupings.

      Specified by:
      groupByMulti in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupByMulti in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupByMulti in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      groupByMulti in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      groupFunction - function returning a list of expressions by which to group results
      Returns:
      a new instance
    • having

      RootStream<X> having(Function<? super jakarta.persistence.criteria.Root<X>,? extends jakarta.persistence.criteria.Expression<Boolean>> havingFunction)
      Description copied from interface: SearchStream
      Add a "having" restriction.

      Adds to any previously specified "having" restrictions.

      Specified by:
      having in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      having in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      having in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      having in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      havingFunction - function returning a test to apply to grouped results
      Returns:
      a new instance
    • findAny

      RootValue<X> findAny()
      Description copied from interface: SearchStream
      Find any instance in the stream.
      Specified by:
      findAny in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findAny in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findAny in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findAny in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Returns:
      single-valued stream containg any instance in this stream (or NULL if this stream is empty)
    • findFirst

      RootValue<X> findFirst()
      Description copied from interface: SearchStream
      Find the first instance in the stream.
      Specified by:
      findFirst in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findFirst in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findFirst in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findFirst in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Returns:
      single-valued stream containg the first instance in this stream (or NULL if this stream is empty)
    • findSingle

      RootValue<X> findSingle()
      Description copied from interface: SearchStream
      Find the only instance in the stream or null.

      Invoke this method only when you know that the result stream contains at most one value, e.g., when searching for an object by its value in a field with a unique constraint. If the stream actually contains multiple values, then invoking any of the "single value" SearchValue methods such as value() or toOptional() will generate a NonUniqueResultException.

      Using this method is preferable to using SearchStream.findFirst() or SearchStream.findAny() for the same purpose, because it not only actually verifies the uniqueness assumption, but it also makes that assumption clearer in the code.

      Example:

        final User user = qb.stream(User.class)
          .filter(u -> qb.equal(u.get(User_.username), username))
          .findSingle()
          .orElseThrow(NoSuchUserException::new);
       
      Specified by:
      findSingle in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findSingle in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findSingle in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      findSingle in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Returns:
      a single value, either the only instance in this stream or null if this stream is empty
    • bind

      RootStream<X> bind(Ref<X,? super jakarta.persistence.criteria.Root<X>> ref)
      Description copied from interface: QueryStream
      Bind an unbound reference to the items in this stream.
      Specified by:
      bind in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      bind in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      bind in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      bind in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      bind in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      ref - unbound reference
      Returns:
      new stream that binds ref
    • peek

      RootStream<X> peek(Consumer<? super jakarta.persistence.criteria.Root<X>> peeker)
      Description copied from interface: QueryStream
      Peek at the items in this stream.

      This is useful in cases where the selection can be modified, e.g., setting join ON conditions using Join.on().

      Specified by:
      peek in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      peek in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      peek in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      peek in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      peek in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      peeker - peeker into stream
      Returns:
      new stream that peeks into this stream
    • bind

      <X2, S2 extends jakarta.persistence.criteria.Selection<X2>> RootStream<X> bind(Ref<X2,? super S2> ref, Function<? super jakarta.persistence.criteria.Root<X>,? extends S2> refFunction)
      Description copied from interface: QueryStream
      Bind an unbound reference to the result of applying the given function to the items in this stream.
      Specified by:
      bind in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      bind in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      bind in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      bind in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      bind in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Type Parameters:
      X2 - type of the bound value
      S2 - criteria type of the bound value
      Parameters:
      ref - unbound reference
      refFunction - function mapping this stream's Selection to the reference value
      Returns:
      new stream that binds ref
    • addRoot

      <R> RootStream<X> addRoot(Ref<R,? super jakarta.persistence.criteria.Root<R>> ref, Class<R> type)
      Description copied from interface: SearchStream
      Bind an unbound reference to a new query root that will be added to the query.

      To select the new root in a SearchStream, use SearchStream.map(), providing a Function that returns ref.

      Note that this effectively creates an unconstrained (cross product) join with the new root. Typically there would be some additional restrictions imposed (e.g., via filter()) to relate the new root to the items in the stream.

      Specified by:
      addRoot in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      addRoot in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      addRoot in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      addRoot in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Type Parameters:
      R - type of the new query root
      Parameters:
      ref - unbound reference
      type - type of the new query root
      Returns:
      new stream that binds ref to a new query root from type
    • filter

      RootStream<X> filter(jakarta.persistence.metamodel.SingularAttribute<? super X,Boolean> attribute)
      Description copied from interface: QueryStream
      Filter results using the specified boolean property.

      Adds to any previously specified filters.

      Specified by:
      filter in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      filter in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      filter in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      filter in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      filter in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute - boolean property
      Returns:
      new filtered stream
    • filter

      RootStream<X> filter(Function<? super jakarta.persistence.criteria.Root<X>,? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder)
      Description copied from interface: QueryStream
      Filter results using the boolean expression produced by the given function.

      Adds to any previously specified filters.

      Specified by:
      filter in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      filter in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      filter in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      filter in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      filter in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      predicateBuilder - function mapping this stream's item to a boolean Expression
      Returns:
      new filtered stream
    • limit

      RootStream<X> limit(int maxSize)
      Description copied from interface: QueryStream
      Return this stream truncated to the specified maximum length.

      Due to limitations in the JPA Criteria API, this method is not supported on subquery streams and in general must be specified last (after any filtering, sorting, grouping, joins, etc.).

      Specified by:
      limit in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      limit in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      limit in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      limit in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      limit in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      maxSize - maximum number of elements to return
      Returns:
      new truncated stream
    • skip

      RootStream<X> skip(int num)
      Description copied from interface: QueryStream
      Return this stream with the specified number of initial elements skipped.

      Due to limitations in the JPA Criteria API, this method is not supported on subquery streams and in general must be specified last (after any filtering, sorting, grouping, joins, etc.).

      Specified by:
      skip in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      skip in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      skip in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      skip in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      skip in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      num - number of elements to skip
      Returns:
      new elided stream
    • withFlushMode

      RootStream<X> withFlushMode(jakarta.persistence.FlushModeType flushMode)
      Description copied from interface: QueryStream
      Set the FlushModeType associated with this query.
      Specified by:
      withFlushMode in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withFlushMode in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withFlushMode in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withFlushMode in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withFlushMode in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      flushMode - new flush mode
      Returns:
      new stream with the specified flush mode configured
      See Also:
      • Query.setFlushMode(jakarta.persistence.FlushModeType)
    • withLockMode

      RootStream<X> withLockMode(jakarta.persistence.LockModeType lockMode)
      Description copied from interface: QueryStream
      Set the LockModeType associated with this query.
      Specified by:
      withLockMode in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withLockMode in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withLockMode in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withLockMode in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withLockMode in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      lockMode - new lock mode
      Returns:
      new stream with the specified lock mode configured
      See Also:
      • Query.setLockMode(jakarta.persistence.LockModeType)
    • withHint

      RootStream<X> withHint(String name, Object value)
      Description copied from interface: QueryStream
      Associate a hint with this query.
      Specified by:
      withHint in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withHint in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withHint in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withHint in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withHint in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      name - name of hint
      value - value of hint
      Returns:
      new stream with the specified hint configured
      See Also:
      • Query.setHint(java.lang.String, java.lang.Object)
    • withHints

      RootStream<X> withHints(Map<String,Object> hints)
      Description copied from interface: QueryStream
      Associate hints with this query.
      Specified by:
      withHints in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withHints in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withHints in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withHints in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withHints in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      hints - hints to add
      Returns:
      new stream with the specified hints added
      See Also:
      • Query.setHint(java.lang.String, java.lang.Object)
    • withParam

      <T> RootStream<X> withParam(jakarta.persistence.Parameter<T> parameter, T value)
      Description copied from interface: QueryStream
      Bind the value of a query parameter.

      Replaces any previous binding of the same parameter.

      Specified by:
      withParam in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withParam in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Type Parameters:
      T - parameter value type
      Parameters:
      parameter - the parameter to set
      value - parameter value
      Returns:
      new stream with the specified parameter value set
      See Also:
      • Query.setParameter(Parameter, Object)
    • withParam

      RootStream<X> withParam(jakarta.persistence.Parameter<Date> parameter, Date value, jakarta.persistence.TemporalType temporalType)
      Description copied from interface: QueryStream
      Bind the value of a query parameter of type Date.

      Replaces any previous binding of the same parameter.

      Specified by:
      withParam in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withParam in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      parameter - the parameter to set
      value - parameter value
      temporalType - temporal type for value
      Returns:
      new stream with the specified parameter value set
      See Also:
      • Query.setParameter(Parameter, Date, TemporalType)
    • withParam

      RootStream<X> withParam(jakarta.persistence.Parameter<Calendar> parameter, Calendar value, jakarta.persistence.TemporalType temporalType)
      Description copied from interface: QueryStream
      Bind the value of a query parameter of type Calendar.

      Replaces any previous binding of the same parameter.

      Specified by:
      withParam in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParam in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withParam in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      parameter - the parameter to set
      value - parameter value
      temporalType - temporal type for value
      Returns:
      new stream with the specified parameter value set
      See Also:
      • Query.setParameter(Parameter, Calendar, TemporalType)
    • withParams

      RootStream<X> withParams(Iterable<? extends ParamBinding<?>> params)
      Description copied from interface: QueryStream
      Associate parameter bindings with this query.

      Replaces any previous bindings of the same parameters.

      Specified by:
      withParams in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParams in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParams in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withParams in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withParams in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      params - bindings to add
      Returns:
      new stream with the specified parameter bindings added
      See Also:
      • Query.setParameter(Parameter, Object)
    • withLoadGraph

      RootStream<X> withLoadGraph(String name)
      Description copied from interface: QueryStream
      Configure a load graph for this query.

      Equivalent to withHint("jakarta.persistence.loadgraph", name).

      Specified by:
      withLoadGraph in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withLoadGraph in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withLoadGraph in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withLoadGraph in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withLoadGraph in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      name - name of load graph
      Returns:
      new stream with the specified load graph configured
    • withFetchGraph

      RootStream<X> withFetchGraph(String name)
      Description copied from interface: QueryStream
      Configure a fetch graph for this query.

      Equivalent to withHint("jakarta.persistence.fetchgraph", name).

      Specified by:
      withFetchGraph in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withFetchGraph in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withFetchGraph in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      withFetchGraph in interface QueryStream<X,jakarta.persistence.criteria.Root<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withFetchGraph in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      name - name of fetch graph
      Returns:
      new stream with the specified fetch graph configured
    • fetch

      RootStream<X> fetch(jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute)
      Description copied from interface: SearchStream
      Add a singular fetch inner join to this stream.

      Equivalent to fetch(attribute, JoinType.INNER).

      Specified by:
      fetch in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute - associated property
      Returns:
      a new stream with specified inner fetch join
    • fetch

      RootStream<X> fetch(jakarta.persistence.metamodel.SingularAttribute<? super X,?> attribute, jakarta.persistence.criteria.JoinType joinType)
      Description copied from interface: SearchStream
      Add a singular fetch join to this stream.

      Unlike join(), this method does not change the stream's content type. In other words, this method is used simply to pre-fetch an association, to avoid having to fetch it again later for each individual element in the stream.

      Specified by:
      fetch in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute - associated property
      joinType - join type
      Returns:
      a new stream with specified fetch join
    • fetch

      RootStream<X> fetch(jakarta.persistence.metamodel.PluralAttribute<? super X,?,?> attribute)
      Description copied from interface: SearchStream
      Add a plural fetch join to this stream.

      Equivalent to fetch(attribute, JoinType.INNER).

      Specified by:
      fetch in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute - associated property
      Returns:
      a new stream with specified inner fetch join
    • fetch

      RootStream<X> fetch(jakarta.persistence.metamodel.PluralAttribute<? super X,?,?> attribute, jakarta.persistence.criteria.JoinType joinType)
      Description copied from interface: SearchStream
      Add a plural fetch join to this stream.

      Unlike join(), this method does not change the stream's content type. In other words, this method is used simply to pre-fetch an association, to avoid having to fetch it again later for each individual element in the stream.

      Specified by:
      fetch in interface ExprStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface FromStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface PathStream<X,jakarta.persistence.criteria.Root<X>>
      Specified by:
      fetch in interface SearchStream<X,jakarta.persistence.criteria.Root<X>>
      Parameters:
      attribute - associated property
      joinType - join type
      Returns:
      a new stream with specified fetch join