public interface LongValue extends ExprValue<Long,Expression<Long>>, LongStream
ExprValue.QueryStream.Builder| Modifier and Type | Method and Description |
|---|---|
LongValue |
bind(Ref<Long,? super Expression<Long>> ref)
Bind an unbound reference to the items in this stream.
|
<X2,S2 extends Selection<X2>> |
bind(Ref<X2,? super S2> ref,
Function<? super Expression<Long>,? extends S2> refFunction)
Bind an unbound reference to the result of applying the given function to the items in this stream.
|
LongValue |
filter(Function<? super Expression<Long>,? extends Expression<Boolean>> predicateBuilder)
Filter results using the boolean expression produced by the given function.
|
default long |
longValue()
Build and evaluate a JPA query based on this instance and return the single non-NULL result.
|
LongValue |
peek(Consumer<? super Expression<Long>> peeker)
Peek at the items in this stream.
|
LongValue |
withFetchGraph(String name)
Configure a fetch graph for this query.
|
LongValue |
withFlushMode(FlushModeType flushMode)
Set the
FlushModeType associated with this query. |
LongValue |
withHint(String name,
Object value)
Associate a hint with this query.
|
LongValue |
withHints(Map<String,Object> hints)
Associate hints with this query.
|
LongValue |
withLoadGraph(String name)
Configure a load graph for this query.
|
LongValue |
withLockMode(LockModeType lockMode)
Set the
LockModeType associated with this query. |
LongValue |
withParam(Parameter<Calendar> parameter,
Calendar value,
TemporalType temporalType)
Bind the value of a query parameter of type
Calendar. |
LongValue |
withParam(Parameter<Date> parameter,
Date value,
TemporalType temporalType)
Bind the value of a query parameter of type
Date. |
<T> LongValue |
withParam(Parameter<T> parameter,
T value)
Bind the value of a query parameter.
|
LongValue |
withParams(Iterable<? extends ParamBinding<?>> params)
Associate parameter bindings with this query.
|
filter, map, map, map, map, mapToDouble, mapToDouble, mapToExpr, mapToFrom, mapToInt, mapToInt, mapToLong, mapToLong, mapToPathifPresent, isPresent, mapToSelection, orElse, orElseGet, orElseThrow, toOptional, valueaddRoot, asDoubleStream, average, distinct, findAny, findFirst, findSingle, groupBy, groupBy, groupByMulti, having, limit, max, min, orderBy, orderBy, orderBy, orderByMulti, skip, sum, thenOrderBy, thenOrderBy, thenOrderByasSubquery, count, countDistinct, exists, fetch, fetch, fetch, fetch, groupBy, orderBy, orderBy, orderBy, thenOrderByallMatch, allMatch, anyMatch, anyMatch, flatMap, flatMap, flatMap, flatMapKeys, flatMapValues, getQueryType, getResultList, getResultStream, isEmpty, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, mapToRef, mapToRef, mapToRef, mapToRef, mapToRoot, noneMatch, noneMatchgetEntityManager, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParams, newBuilder, toCriteriaQuery, toQueryconfiguredefault long longValue()
This variant of SearchValue.value() is useful when it is known that NULL won't be returned.
NoResultException - if the query returns NULLLongValue bind(Ref<Long,? super Expression<Long>> ref)
QueryStreambind in interface ExprStream<Long,Expression<Long>>bind in interface ExprValue<Long,Expression<Long>>bind in interface LongStreambind in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>bind in interface SearchStream<Long,Expression<Long>>bind in interface SearchValue<Long,Expression<Long>>ref - unbound referencerefLongValue peek(Consumer<? super Expression<Long>> peeker)
QueryStream
This is useful in cases where the selection can be modified, e.g., setting join ON conditions
using Join.on().
peek in interface ExprStream<Long,Expression<Long>>peek in interface ExprValue<Long,Expression<Long>>peek in interface LongStreampeek in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>peek in interface SearchStream<Long,Expression<Long>>peek in interface SearchValue<Long,Expression<Long>>peeker - peeker into stream<X2,S2 extends Selection<X2>> LongValue bind(Ref<X2,? super S2> ref, Function<? super Expression<Long>,? extends S2> refFunction)
QueryStreambind in interface ExprStream<Long,Expression<Long>>bind in interface ExprValue<Long,Expression<Long>>bind in interface LongStreambind in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>bind in interface SearchStream<Long,Expression<Long>>bind in interface SearchValue<Long,Expression<Long>>X2 - type of the bound valueS2 - criteria type of the bound valueref - unbound referencerefFunction - function mapping this stream's Selection to the reference valuerefLongValue filter(Function<? super Expression<Long>,? extends Expression<Boolean>> predicateBuilder)
QueryStreamAdds to any previously specified filters.
filter in interface ExprStream<Long,Expression<Long>>filter in interface ExprValue<Long,Expression<Long>>filter in interface LongStreamfilter in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>filter in interface SearchStream<Long,Expression<Long>>filter in interface SearchValue<Long,Expression<Long>>predicateBuilder - function mapping this stream's item to a boolean ExpressionLongValue withFlushMode(FlushModeType flushMode)
QueryStreamFlushModeType associated with this query.withFlushMode in interface ExprStream<Long,Expression<Long>>withFlushMode in interface ExprValue<Long,Expression<Long>>withFlushMode in interface LongStreamwithFlushMode in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withFlushMode in interface SearchStream<Long,Expression<Long>>withFlushMode in interface SearchValue<Long,Expression<Long>>flushMode - new flush modeQuery.setFlushMode(javax.persistence.FlushModeType)LongValue withLockMode(LockModeType lockMode)
QueryStreamLockModeType associated with this query.withLockMode in interface ExprStream<Long,Expression<Long>>withLockMode in interface ExprValue<Long,Expression<Long>>withLockMode in interface LongStreamwithLockMode in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withLockMode in interface SearchStream<Long,Expression<Long>>withLockMode in interface SearchValue<Long,Expression<Long>>lockMode - new lock modeQuery.setLockMode(javax.persistence.LockModeType)LongValue withHint(String name, Object value)
QueryStreamwithHint in interface ExprStream<Long,Expression<Long>>withHint in interface ExprValue<Long,Expression<Long>>withHint in interface LongStreamwithHint in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withHint in interface SearchStream<Long,Expression<Long>>withHint in interface SearchValue<Long,Expression<Long>>name - name of hintvalue - value of hintQuery.setHint(java.lang.String, java.lang.Object)LongValue withHints(Map<String,Object> hints)
QueryStreamwithHints in interface ExprStream<Long,Expression<Long>>withHints in interface ExprValue<Long,Expression<Long>>withHints in interface LongStreamwithHints in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withHints in interface SearchStream<Long,Expression<Long>>withHints in interface SearchValue<Long,Expression<Long>>hints - hints to addQuery.setHint(java.lang.String, java.lang.Object)<T> LongValue withParam(Parameter<T> parameter, T value)
QueryStreamReplaces any previous binding of the same parameter.
withParam in interface ExprStream<Long,Expression<Long>>withParam in interface ExprValue<Long,Expression<Long>>withParam in interface LongStreamwithParam in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withParam in interface SearchStream<Long,Expression<Long>>withParam in interface SearchValue<Long,Expression<Long>>T - parameter value typeparameter - the parameter to setvalue - parameter valueQuery.setParameter(javax.persistence.Parameter, Object)LongValue withParam(Parameter<Date> parameter, Date value, TemporalType temporalType)
QueryStreamDate.
Replaces any previous binding of the same parameter.
withParam in interface ExprStream<Long,Expression<Long>>withParam in interface ExprValue<Long,Expression<Long>>withParam in interface LongStreamwithParam in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withParam in interface SearchStream<Long,Expression<Long>>withParam in interface SearchValue<Long,Expression<Long>>parameter - the parameter to setvalue - parameter valuetemporalType - temporal type for valueQuery.setParameter(javax.persistence.Parameter, Date, TemporalType)LongValue withParam(Parameter<Calendar> parameter, Calendar value, TemporalType temporalType)
QueryStreamCalendar.
Replaces any previous binding of the same parameter.
withParam in interface ExprStream<Long,Expression<Long>>withParam in interface ExprValue<Long,Expression<Long>>withParam in interface LongStreamwithParam in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withParam in interface SearchStream<Long,Expression<Long>>withParam in interface SearchValue<Long,Expression<Long>>parameter - the parameter to setvalue - parameter valuetemporalType - temporal type for valueQuery.setParameter(javax.persistence.Parameter, Calendar, TemporalType)LongValue withParams(Iterable<? extends ParamBinding<?>> params)
QueryStreamReplaces any previous bindings of the same parameters.
withParams in interface ExprStream<Long,Expression<Long>>withParams in interface ExprValue<Long,Expression<Long>>withParams in interface LongStreamwithParams in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withParams in interface SearchStream<Long,Expression<Long>>withParams in interface SearchValue<Long,Expression<Long>>params - bindings to addQuery.setParameter(javax.persistence.Parameter, Object)LongValue withLoadGraph(String name)
QueryStream
Equivalent to withHint("javax.persistence.loadgraph", name).
withLoadGraph in interface ExprStream<Long,Expression<Long>>withLoadGraph in interface ExprValue<Long,Expression<Long>>withLoadGraph in interface LongStreamwithLoadGraph in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withLoadGraph in interface SearchStream<Long,Expression<Long>>withLoadGraph in interface SearchValue<Long,Expression<Long>>name - name of load graphLongValue withFetchGraph(String name)
QueryStream
Equivalent to withHint("javax.persistence.fetchgraph", name).
withFetchGraph in interface ExprStream<Long,Expression<Long>>withFetchGraph in interface ExprValue<Long,Expression<Long>>withFetchGraph in interface LongStreamwithFetchGraph in interface QueryStream<Long,Expression<Long>,AbstractQuery<?>,CriteriaQuery<Long>,TypedQuery<Long>>withFetchGraph in interface SearchStream<Long,Expression<Long>>withFetchGraph in interface SearchValue<Long,Expression<Long>>name - name of fetch graphCopyright © 2023. All rights reserved.