Interface LongValue

All Superinterfaces:
ExprStream<Long,jakarta.persistence.criteria.Expression<Long>>, ExprValue<Long,jakarta.persistence.criteria.Expression<Long>>, LongStream, QueryConfigurer<jakarta.persistence.criteria.AbstractQuery<?>,Long,jakarta.persistence.criteria.Expression<Long>>, QueryStream<Long,jakarta.persistence.criteria.Expression<Long>,jakarta.persistence.criteria.AbstractQuery<?>,jakarta.persistence.criteria.CriteriaQuery<Long>,jakarta.persistence.TypedQuery<Long>>, SearchStream<Long,jakarta.persistence.criteria.Expression<Long>>, SearchValue<Long,jakarta.persistence.criteria.Expression<Long>>

public interface LongValue extends ExprValue<Long,jakarta.persistence.criteria.Expression<Long>>, LongStream
A long ExprValue.
  • Method Details

    • longValue

      default long longValue()
      Build and evaluate a JPA query based on this instance and return the single non-NULL result.

      This variant of SearchValue.value() is useful when it is known that NULL won't be returned.

      Returns:
      result of executed query
      Throws:
      jakarta.persistence.NoResultException - if the query returns NULL
    • bind

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

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

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

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

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

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

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

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

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

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

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

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

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