public interface ExprValue<X,S extends Expression<X>> extends SearchValue<X,S>, ExprStream<X,S>
ExprStream that is guaranteed to return at most a single result.QueryStream.Builder| Modifier and Type | Method and Description |
|---|---|
ExprValue<X,S> |
bind(Ref<X,? super S> ref)
Bind an unbound reference to the items in this stream.
|
<X2,S2 extends Selection<X2>> |
bind(Ref<X2,? super S2> ref,
Function<? super S,? extends S2> refFunction)
Bind an unbound reference to the result of applying the given function to the items in this stream.
|
ExprValue<X,S> |
filter(Function<? super S,? extends Expression<Boolean>> predicateBuilder)
Filter results using the boolean expression produced by the given function.
|
ExprValue<X,S> |
filter(SingularAttribute<? super X,Boolean> attribute)
Filter results using the specified boolean property.
|
default <Y> ExprValue<Y,Expression<Y>> |
map(Class<Y> type,
Function<? super S,? extends Expression<Y>> exprFunction)
Map this stream into a stream whose elements are the result of applying the given function.
|
default <K,V,M extends Map<K,V>> |
map(MapAttribute<? super X,K,V> attribute)
Map this stream to an associated map property.
|
default <E,C extends Collection<E>> |
map(PluralAttribute<? super X,C,E> attribute)
Map this stream to an associated collection property.
|
default <Y> PathValue<Y,Path<Y>> |
map(SingularAttribute<? super X,Y> attribute)
Map this stream to an associated property.
|
default DoubleValue |
mapToDouble(Function<? super S,? extends Expression<? extends Number>> doubleExprFunction)
Map this stream into a stream of double values that are the result of applying the given function.
|
default DoubleValue |
mapToDouble(SingularAttribute<? super X,? extends Number> attribute)
Map this stream to an associated floating point value.
|
default <Y> ExprValue<Y,Expression<Y>> |
mapToExpr(Class<Y> type,
Function<? super S,? extends Expression<Y>> exprFunction)
Map this stream into a stream whose elements are the result of applying the given function.
|
default <Z,Y> FromValue<Y,From<Z,Y>> |
mapToFrom(Class<Y> type,
Function<? super S,? extends From<Z,Y>> fromFunction)
Map this stream into a stream whose elements are the result of applying the given function.
|
default IntValue |
mapToInt(Function<? super S,? extends Expression<? extends Number>> intExprFunction)
Map this stream into a stream of integer values that are the result of applying the given function.
|
default IntValue |
mapToInt(SingularAttribute<? super X,? extends Number> attribute)
Map this stream to an associated integer value.
|
default LongValue |
mapToLong(Function<? super S,? extends Expression<? extends Number>> longExprFunction)
Map this stream into a stream of long values that are the result of applying the given function.
|
default LongValue |
mapToLong(SingularAttribute<? super X,? extends Number> attribute)
Map this stream to an associated long value.
|
default <Y> PathValue<Y,Path<Y>> |
mapToPath(Class<Y> type,
Function<? super S,? extends Path<Y>> pathFunction)
Map this stream into a stream whose elements are the result of applying the given function.
|
ExprValue<X,S> |
peek(Consumer<? super S> peeker)
Peek at the items in this stream.
|
ExprValue<X,S> |
withFetchGraph(String name)
Configure a fetch graph for this query.
|
ExprValue<X,S> |
withFlushMode(FlushModeType flushMode)
Set the
FlushModeType associated with this query. |
ExprValue<X,S> |
withHint(String name,
Object value)
Associate a hint with this query.
|
ExprValue<X,S> |
withHints(Map<String,Object> hints)
Associate hints with this query.
|
ExprValue<X,S> |
withLoadGraph(String name)
Configure a load graph for this query.
|
ExprValue<X,S> |
withLockMode(LockModeType lockMode)
Set the
LockModeType associated with this query. |
ExprValue<X,S> |
withParam(Parameter<Calendar> parameter,
Calendar value,
TemporalType temporalType)
Bind the value of a query parameter of type
Calendar. |
ExprValue<X,S> |
withParam(Parameter<Date> parameter,
Date value,
TemporalType temporalType)
Bind the value of a query parameter of type
Date. |
<T> ExprValue<X,S> |
withParam(Parameter<T> parameter,
T value)
Bind the value of a query parameter.
|
ExprValue<X,S> |
withParams(Iterable<? extends ParamBinding<?>> params)
Associate parameter bindings with this query.
|
ifPresent, isPresent, mapToSelection, orElse, orElseGet, orElseThrow, toOptional, valueaddRoot, asSubquery, count, countDistinct, distinct, exists, fetch, fetch, fetch, fetch, findAny, findFirst, findSingle, groupBy, groupBy, groupBy, groupByMulti, having, limit, orderBy, orderBy, orderBy, orderBy, orderBy, orderBy, orderByMulti, skip, thenOrderBy, thenOrderBy, thenOrderBy, 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 <Y> PathValue<Y,Path<Y>> map(SingularAttribute<? super X,Y> attribute)
SearchStream
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.
map in interface SearchStream<X,S extends Expression<X>>Y - property typeattribute - associated propertydefault <Y> ExprValue<Y,Expression<Y>> map(Class<Y> type, Function<? super S,? extends Expression<Y>> exprFunction)
SearchStreammap in interface SearchStream<X,S extends Expression<X>>Y - mapped expression typetype - new item typeexprFunction - function mapping this stream's Expression to a Expressiondefault <E,C extends Collection<E>> ExprValue<C,Expression<C>> map(PluralAttribute<? super X,C,E> attribute)
SearchStreammap in interface SearchStream<X,S extends Expression<X>>E - collection element typeC - collection typeattribute - associated propertydefault <K,V,M extends Map<K,V>> ExprValue<M,Expression<M>> map(MapAttribute<? super X,K,V> attribute)
SearchStreammap in interface SearchStream<X,S extends Expression<X>>K - map key typeV - map value typeM - map typeattribute - associated propertydefault <Y> ExprValue<Y,Expression<Y>> mapToExpr(Class<Y> type, Function<? super S,? extends Expression<Y>> exprFunction)
SearchStreammapToExpr in interface SearchStream<X,S extends Expression<X>>Y - mapped target typetype - new item typeexprFunction - function mapping this stream's Selection to an Expressiondefault <Y> PathValue<Y,Path<Y>> mapToPath(Class<Y> type, Function<? super S,? extends Path<Y>> pathFunction)
SearchStreammapToPath in interface SearchStream<X,S extends Expression<X>>Y - mapped expresssion typetype - new item typepathFunction - function mapping this stream's Selection to a Pathdefault <Z,Y> FromValue<Y,From<Z,Y>> mapToFrom(Class<Y> type, Function<? super S,? extends From<Z,Y>> fromFunction)
SearchStreammapToFrom in interface SearchStream<X,S extends Expression<X>>Z - mapped source typeY - mapped target typetype - new item typefromFunction - function mapping this stream's Selection to a Fromdefault DoubleValue mapToDouble(SingularAttribute<? super X,? extends Number> attribute)
SearchStreammapToDouble in interface SearchStream<X,S extends Expression<X>>attribute - associated numerically-valued propertydefault DoubleValue mapToDouble(Function<? super S,? extends Expression<? extends Number>> doubleExprFunction)
SearchStreammapToDouble in interface SearchStream<X,S extends Expression<X>>doubleExprFunction - function mapping this stream's Expression to a numerical Expressiondefault LongValue mapToLong(SingularAttribute<? super X,? extends Number> attribute)
SearchStreammapToLong in interface SearchStream<X,S extends Expression<X>>attribute - associated numerically-valued propertydefault LongValue mapToLong(Function<? super S,? extends Expression<? extends Number>> longExprFunction)
SearchStreammapToLong in interface SearchStream<X,S extends Expression<X>>longExprFunction - function mapping this stream's Expression to a numerical Expressiondefault IntValue mapToInt(SingularAttribute<? super X,? extends Number> attribute)
SearchStreammapToInt in interface SearchStream<X,S extends Expression<X>>attribute - associated numerically-valued propertydefault IntValue mapToInt(Function<? super S,? extends Expression<? extends Number>> intExprFunction)
SearchStreammapToInt in interface SearchStream<X,S extends Expression<X>>intExprFunction - function mapping this stream's Expression to a numerical ExpressionExprValue<X,S> bind(Ref<X,? super S> ref)
QueryStreambind in interface ExprStream<X,S extends Expression<X>>bind in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>bind in interface SearchStream<X,S extends Expression<X>>bind in interface SearchValue<X,S extends Expression<X>>ref - unbound referencerefExprValue<X,S> peek(Consumer<? super S> 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<X,S extends Expression<X>>peek in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>peek in interface SearchStream<X,S extends Expression<X>>peek in interface SearchValue<X,S extends Expression<X>>peeker - peeker into stream<X2,S2 extends Selection<X2>> ExprValue<X,S> bind(Ref<X2,? super S2> ref, Function<? super S,? extends S2> refFunction)
QueryStreambind in interface ExprStream<X,S extends Expression<X>>bind in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>bind in interface SearchStream<X,S extends Expression<X>>bind in interface SearchValue<X,S extends Expression<X>>X2 - type of the bound valueS2 - criteria type of the bound valueref - unbound referencerefFunction - function mapping this stream's Selection to the reference valuerefExprValue<X,S> filter(SingularAttribute<? super X,Boolean> attribute)
QueryStreamAdds to any previously specified filters.
filter in interface ExprStream<X,S extends Expression<X>>filter in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>filter in interface SearchStream<X,S extends Expression<X>>filter in interface SearchValue<X,S extends Expression<X>>attribute - boolean propertyExprValue<X,S> filter(Function<? super S,? extends Expression<Boolean>> predicateBuilder)
QueryStreamAdds to any previously specified filters.
filter in interface ExprStream<X,S extends Expression<X>>filter in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>filter in interface SearchStream<X,S extends Expression<X>>filter in interface SearchValue<X,S extends Expression<X>>predicateBuilder - function mapping this stream's item to a boolean ExpressionExprValue<X,S> withFlushMode(FlushModeType flushMode)
QueryStreamFlushModeType associated with this query.withFlushMode in interface ExprStream<X,S extends Expression<X>>withFlushMode in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withFlushMode in interface SearchStream<X,S extends Expression<X>>withFlushMode in interface SearchValue<X,S extends Expression<X>>flushMode - new flush modeQuery.setFlushMode(javax.persistence.FlushModeType)ExprValue<X,S> withLockMode(LockModeType lockMode)
QueryStreamLockModeType associated with this query.withLockMode in interface ExprStream<X,S extends Expression<X>>withLockMode in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withLockMode in interface SearchStream<X,S extends Expression<X>>withLockMode in interface SearchValue<X,S extends Expression<X>>lockMode - new lock modeQuery.setLockMode(javax.persistence.LockModeType)ExprValue<X,S> withHint(String name, Object value)
QueryStreamwithHint in interface ExprStream<X,S extends Expression<X>>withHint in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withHint in interface SearchStream<X,S extends Expression<X>>withHint in interface SearchValue<X,S extends Expression<X>>name - name of hintvalue - value of hintQuery.setHint(java.lang.String, java.lang.Object)ExprValue<X,S> withHints(Map<String,Object> hints)
QueryStreamwithHints in interface ExprStream<X,S extends Expression<X>>withHints in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withHints in interface SearchStream<X,S extends Expression<X>>withHints in interface SearchValue<X,S extends Expression<X>>hints - hints to addQuery.setHint(java.lang.String, java.lang.Object)<T> ExprValue<X,S> withParam(Parameter<T> parameter, T value)
QueryStreamReplaces any previous binding of the same parameter.
withParam in interface ExprStream<X,S extends Expression<X>>withParam in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withParam in interface SearchStream<X,S extends Expression<X>>withParam in interface SearchValue<X,S extends Expression<X>>T - parameter value typeparameter - the parameter to setvalue - parameter valueQuery.setParameter(javax.persistence.Parameter, Object)ExprValue<X,S> withParam(Parameter<Date> parameter, Date value, TemporalType temporalType)
QueryStreamDate.
Replaces any previous binding of the same parameter.
withParam in interface ExprStream<X,S extends Expression<X>>withParam in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withParam in interface SearchStream<X,S extends Expression<X>>withParam in interface SearchValue<X,S extends Expression<X>>parameter - the parameter to setvalue - parameter valuetemporalType - temporal type for valueQuery.setParameter(javax.persistence.Parameter, Date, TemporalType)ExprValue<X,S> withParam(Parameter<Calendar> parameter, Calendar value, TemporalType temporalType)
QueryStreamCalendar.
Replaces any previous binding of the same parameter.
withParam in interface ExprStream<X,S extends Expression<X>>withParam in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withParam in interface SearchStream<X,S extends Expression<X>>withParam in interface SearchValue<X,S extends Expression<X>>parameter - the parameter to setvalue - parameter valuetemporalType - temporal type for valueQuery.setParameter(javax.persistence.Parameter, Calendar, TemporalType)ExprValue<X,S> withParams(Iterable<? extends ParamBinding<?>> params)
QueryStreamReplaces any previous bindings of the same parameters.
withParams in interface ExprStream<X,S extends Expression<X>>withParams in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withParams in interface SearchStream<X,S extends Expression<X>>withParams in interface SearchValue<X,S extends Expression<X>>params - bindings to addQuery.setParameter(javax.persistence.Parameter, Object)ExprValue<X,S> withLoadGraph(String name)
QueryStream
Equivalent to withHint("javax.persistence.loadgraph", name).
withLoadGraph in interface ExprStream<X,S extends Expression<X>>withLoadGraph in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withLoadGraph in interface SearchStream<X,S extends Expression<X>>withLoadGraph in interface SearchValue<X,S extends Expression<X>>name - name of load graphExprValue<X,S> withFetchGraph(String name)
QueryStream
Equivalent to withHint("javax.persistence.fetchgraph", name).
withFetchGraph in interface ExprStream<X,S extends Expression<X>>withFetchGraph in interface QueryStream<X,S extends Expression<X>,AbstractQuery<?>,CriteriaQuery<X>,TypedQuery<X>>withFetchGraph in interface SearchStream<X,S extends Expression<X>>withFetchGraph in interface SearchValue<X,S extends Expression<X>>name - name of fetch graphCopyright © 2023. All rights reserved.