Interface ExprValue<X,S extends jakarta.persistence.criteria.Expression<X>>

All Superinterfaces:
ExprStream<X,S>, QueryConfigurer<jakarta.persistence.criteria.AbstractQuery<?>,X,S>, QueryStream<X,S,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>, SearchStream<X,S>, SearchValue<X,S>
All Known Subinterfaces:
BooleanValue, DoubleValue, FromValue<X,S>, IntValue, LongValue, PathValue<X,S>, RootValue<X>

public interface ExprValue<X,S extends jakarta.persistence.criteria.Expression<X>> extends SearchValue<X,S>, ExprStream<X,S>
An ExprStream that is guaranteed to return at most a single result.
  • Method Details

    • map

      default <Y> PathValue<Y,jakarta.persistence.criteria.Path<Y>> map(jakarta.persistence.metamodel.SingularAttribute<? super X,Y> attribute)
      Description copied from interface: SearchStream
      Map this stream to an associated property.

      Unlike join(), this method allows mapping to arbitrary, non-entity properties.

      If the property is an entity, then this method works just like an inner join(). In particular, the associated entity must exist. For that reason, and also because join() returns the more specific type FromStream, join() is preferred over this method when the associated property is an entity.

      Specified by:
      map in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Type Parameters:
      Y - property type
      Parameters:
      attribute - associated property
      Returns:
      mapped stream
    • map

      default <Y> ExprValue<Y,jakarta.persistence.criteria.Expression<Y>> map(Class<Y> type, Function<? super S,? extends jakarta.persistence.criteria.Expression<Y>> exprFunction)
      Description copied from interface: SearchStream
      Map this stream into a stream whose elements are the result of applying the given function.
      Specified by:
      map in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Type Parameters:
      Y - mapped expression type
      Parameters:
      type - new item type
      exprFunction - function mapping this stream's Expression to a Expression
      Returns:
      mapped stream
    • map

      default <E, C extends Collection<E>> ExprValue<C,jakarta.persistence.criteria.Expression<C>> map(jakarta.persistence.metamodel.PluralAttribute<? super X,C,E> attribute)
      Description copied from interface: SearchStream
      Map this stream to an associated collection property.
      Specified by:
      map in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Type Parameters:
      E - collection element type
      C - collection type
      Parameters:
      attribute - associated property
      Returns:
      mapped stream
    • map

      default <K, V, M extends Map<K, V>> ExprValue<M,jakarta.persistence.criteria.Expression<M>> map(jakarta.persistence.metamodel.MapAttribute<? super X,K,V> attribute)
      Description copied from interface: SearchStream
      Map this stream to an associated map property.
      Specified by:
      map in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Type Parameters:
      K - map key type
      V - map value type
      M - map type
      Parameters:
      attribute - associated property
      Returns:
      mapped stream
    • mapToExpr

      default <Y> ExprValue<Y,jakarta.persistence.criteria.Expression<Y>> mapToExpr(Class<Y> type, Function<? super S,? extends jakarta.persistence.criteria.Expression<Y>> exprFunction)
      Description copied from interface: SearchStream
      Map this stream into a stream whose elements are the result of applying the given function.
      Specified by:
      mapToExpr in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Type Parameters:
      Y - mapped target type
      Parameters:
      type - new item type
      exprFunction - function mapping this stream's Selection to an Expression
      Returns:
      mapped stream
    • mapToPath

      default <Y> PathValue<Y,jakarta.persistence.criteria.Path<Y>> mapToPath(Class<Y> type, Function<? super S,? extends jakarta.persistence.criteria.Path<Y>> pathFunction)
      Description copied from interface: SearchStream
      Map this stream into a stream whose elements are the result of applying the given function.
      Specified by:
      mapToPath in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Type Parameters:
      Y - mapped expresssion type
      Parameters:
      type - new item type
      pathFunction - function mapping this stream's Selection to a Path
      Returns:
      mapped stream
    • mapToFrom

      default <Z, Y> FromValue<Y,jakarta.persistence.criteria.From<Z,Y>> mapToFrom(Class<Y> type, Function<? super S,? extends jakarta.persistence.criteria.From<Z,Y>> fromFunction)
      Description copied from interface: SearchStream
      Map this stream into a stream whose elements are the result of applying the given function.
      Specified by:
      mapToFrom in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Type Parameters:
      Z - mapped source type
      Y - mapped target type
      Parameters:
      type - new item type
      fromFunction - function mapping this stream's Selection to a From
      Returns:
      mapped stream
    • mapToDouble

      default DoubleValue mapToDouble(jakarta.persistence.metamodel.SingularAttribute<? super X,? extends Number> attribute)
      Description copied from interface: SearchStream
      Map this stream to an associated floating point value.
      Specified by:
      mapToDouble in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      attribute - associated numerically-valued property
      Returns:
      mapped stream of doubles
    • mapToDouble

      default DoubleValue mapToDouble(Function<? super S,? extends jakarta.persistence.criteria.Expression<? extends Number>> doubleExprFunction)
      Description copied from interface: SearchStream
      Map this stream into a stream of double values that are the result of applying the given function.
      Specified by:
      mapToDouble in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      doubleExprFunction - function mapping this stream's Expression to a numerical Expression
      Returns:
      mapped stream of doubles
    • mapToLong

      default LongValue mapToLong(jakarta.persistence.metamodel.SingularAttribute<? super X,? extends Number> attribute)
      Description copied from interface: SearchStream
      Map this stream to an associated long value.
      Specified by:
      mapToLong in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      attribute - associated numerically-valued property
      Returns:
      mapped stream of longs
    • mapToLong

      default LongValue mapToLong(Function<? super S,? extends jakarta.persistence.criteria.Expression<? extends Number>> longExprFunction)
      Description copied from interface: SearchStream
      Map this stream into a stream of long values that are the result of applying the given function.
      Specified by:
      mapToLong in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      longExprFunction - function mapping this stream's Expression to a numerical Expression
      Returns:
      mapped stream of longs
    • mapToInt

      default IntValue mapToInt(jakarta.persistence.metamodel.SingularAttribute<? super X,? extends Number> attribute)
      Description copied from interface: SearchStream
      Map this stream to an associated integer value.
      Specified by:
      mapToInt in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      attribute - associated numerically-valued property
      Returns:
      mapped stream of integers
    • mapToInt

      default IntValue mapToInt(Function<? super S,? extends jakarta.persistence.criteria.Expression<? extends Number>> intExprFunction)
      Description copied from interface: SearchStream
      Map this stream into a stream of integer values that are the result of applying the given function.
      Specified by:
      mapToInt in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      intExprFunction - function mapping this stream's Expression to a numerical Expression
      Returns:
      mapped stream of integers
    • bind

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

      ExprValue<X,S> peek(Consumer<? super S> 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      peek in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      peek in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      peek in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      peeker - peeker into stream
      Returns:
      new stream that peeks into this stream
    • bind

      <X2, S2 extends jakarta.persistence.criteria.Selection<X2>> ExprValue<X,S> bind(Ref<X2,? super S2> ref, Function<? super S,? 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      bind in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      bind in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      bind in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<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
    • filter

      ExprValue<X,S> 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      filter in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      filter in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      filter in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      attribute - boolean property
      Returns:
      new filtered stream
    • filter

      ExprValue<X,S> filter(Function<? super S,? 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      filter in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      filter in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      filter in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      predicateBuilder - function mapping this stream's item to a boolean Expression
      Returns:
      new filtered stream
    • withFlushMode

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

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

      ExprValue<X,S> withHint(String name, Object value)
      Description copied from interface: QueryStream
      Associate a hint with this query.
      Specified by:
      withHint in interface ExprStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withHint in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withHint in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withHint in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<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

      ExprValue<X,S> withHints(Map<String,Object> hints)
      Description copied from interface: QueryStream
      Associate hints with this query.
      Specified by:
      withHints in interface ExprStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withHints in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withHints in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withHints in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<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> ExprValue<X,S> 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withParam in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withParam in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withParam in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<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

      ExprValue<X,S> 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withParam in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withParam in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withParam in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<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

      ExprValue<X,S> 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withParam in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withParam in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withParam in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<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

      ExprValue<X,S> 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withParams in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withParams in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withParams in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      params - bindings to add
      Returns:
      new stream with the specified parameter bindings added
      See Also:
      • Query.setParameter(Parameter, Object)
    • withLoadGraph

      ExprValue<X,S> 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withLoadGraph in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withLoadGraph in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withLoadGraph in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      name - name of load graph
      Returns:
      new stream with the specified load graph configured
    • withFetchGraph

      ExprValue<X,S> 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,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withFetchGraph in interface QueryStream<X,S extends jakarta.persistence.criteria.Expression<X>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<X>,jakarta.persistence.TypedQuery<X>>
      Specified by:
      withFetchGraph in interface SearchStream<X,S extends jakarta.persistence.criteria.Expression<X>>
      Specified by:
      withFetchGraph in interface SearchValue<X,S extends jakarta.persistence.criteria.Expression<X>>
      Parameters:
      name - name of fetch graph
      Returns:
      new stream with the specified fetch graph configured