Interface SearchStream<X,S extends jakarta.persistence.criteria.Selection<X>>
- Type Parameters:
X- stream item typeS- criteria type for stream item
- All Superinterfaces:
QueryConfigurer<jakarta.persistence.criteria.AbstractQuery<?>,,X, S> QueryStream<X,S, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>>
- All Known Subinterfaces:
BooleanValue,DoubleStream,DoubleValue,ExprStream<X,,S> ExprValue<X,,S> FromStream<X,,S> FromValue<X,,S> IntStream,IntValue,LongStream,LongValue,PathStream<X,,S> PathValue<X,,S> RootStream<X>,RootValue<X>,SearchValue<X,S>
Stream-like API.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.dellroad.querystream.jpa.QueryStream
QueryStream.Builder -
Method Summary
Modifier and TypeMethodDescription<R> SearchStream<X,S> Bind an unbound reference to a new query root that will be added to the query.booleanExecute this query and return true if the given property is true for every resulting item.booleanallMatch(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder) Execute this query and return true if the predicate returned by the given function is true for every resulting item.booleanExecute this query and return true if any results are found for which the given property is true.booleananyMatch(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder) Execute this query and return true if any results are found for which the predicate returned by the given function is true.Bind an unbound reference to the items in this stream.<X2,S2 extends jakarta.persistence.criteria.Selection<X2>>
SearchStream<X,S> Bind an unbound reference to the result of applying the given function to the items in this stream.distinct()Suppress duplicates.Add a plural fetch join to this stream.fetch(jakarta.persistence.metamodel.PluralAttribute<? super X, ?, ?> attribute, jakarta.persistence.criteria.JoinType joinType) Add a plural fetch join to this stream.Add a singular fetch inner join to this stream.fetch(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute, jakarta.persistence.criteria.JoinType joinType) Add a singular fetch join to this stream.Filter results using the specified boolean property.filter(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder) Filter results using the boolean expression produced by the given function.findAny()Find any instance in the stream.Find the first instance in the stream.Find the only instance in the stream or null.default <E> FromStream<E,jakarta.persistence.criteria.CollectionJoin<X, E>> Map this stream to a stream where every item is replaced with the contents of the specified collection.default <E> FromStream<E,jakarta.persistence.criteria.ListJoin<X, E>> Map this stream to a stream where every item is replaced with the contents of the specified collection.default <E> FromStream<E,jakarta.persistence.criteria.SetJoin<X, E>> Map this stream to a stream where every item is replaced with the contents of the specified collection.default <K> PathStream<K,jakarta.persistence.criteria.Path<K>> flatMapKeys(jakarta.persistence.metamodel.MapAttribute<? super X, K, ?> attribute) Map this stream to a stream where every item is replaced with the keys of the specified map.default <V> PathStream<V,jakarta.persistence.criteria.Path<V>> flatMapValues(jakarta.persistence.metamodel.MapAttribute<? super X, ?, V> attribute) Map this stream to a stream where every item is replaced with the values of the specified map.Get theQueryTypeof this instance.Build and evaluate a JPA query based on this instance and return the result list.Build and evaluate a JPA query based on this instance and return the result stream.Apply grouping based on the specified property.Apply grouping based on a single expression.Apply grouping based on an expression reference.groupByMulti(Function<? super S, ? extends List<jakarta.persistence.criteria.Expression<?>>> groupFunction) Apply grouping based on a list of expressions.having(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> havingFunction) Add a "having" restriction.booleanisEmpty()Execute this query and return true if no results are found.default <E> FromStream<E,jakarta.persistence.criteria.CollectionJoin<X, E>> Add a collection inner join to this stream.default <E> FromStream<E,jakarta.persistence.criteria.CollectionJoin<X, E>> join(jakarta.persistence.metamodel.CollectionAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType) Add a collection join to this stream using the specified join type.default <E> FromStream<E,jakarta.persistence.criteria.CollectionJoin<X, E>> join(jakarta.persistence.metamodel.CollectionAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.CollectionJoin<X, E>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a collection join to this stream using the specified join type and ON condition.default <E> FromStream<E,jakarta.persistence.criteria.ListJoin<X, E>> Add a list inner join to this stream.default <E> FromStream<E,jakarta.persistence.criteria.ListJoin<X, E>> join(jakarta.persistence.metamodel.ListAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType) Add a list join to this stream using the specified join type.default <E> FromStream<E,jakarta.persistence.criteria.ListJoin<X, E>> join(jakarta.persistence.metamodel.ListAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.ListJoin<X, E>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a list join to this stream using the specified join type and ON condition.default <K,V> FromStream<V, jakarta.persistence.criteria.MapJoin<X, K, V>> Add a map inner join to this stream.default <K,V> FromStream<V, jakarta.persistence.criteria.MapJoin<X, K, V>> join(jakarta.persistence.metamodel.MapAttribute<? super X, K, V> attribute, jakarta.persistence.criteria.JoinType joinType) Add a map join to this stream using the specified join type.default <K,V> FromStream<V, jakarta.persistence.criteria.MapJoin<X, K, V>> join(jakarta.persistence.metamodel.MapAttribute<? super X, K, V> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.MapJoin<X, K, V>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a map join to this stream using the specified join type and ON condition.default <E> FromStream<E,jakarta.persistence.criteria.SetJoin<X, E>> Add a set inner join to this stream.default <E> FromStream<E,jakarta.persistence.criteria.SetJoin<X, E>> join(jakarta.persistence.metamodel.SetAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType) Add a set join to this stream using the specified join type.default <E> FromStream<E,jakarta.persistence.criteria.SetJoin<X, E>> join(jakarta.persistence.metamodel.SetAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.SetJoin<X, E>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a set join to this stream using the specified join type and ON condition.default <Y> FromStream<Y,jakarta.persistence.criteria.From<X, Y>> Add a singular inner join to this stream.default <Y> FromStream<Y,jakarta.persistence.criteria.From<X, Y>> join(jakarta.persistence.metamodel.SingularAttribute<? super X, Y> attribute, jakarta.persistence.criteria.JoinType joinType) Add a singular join to this stream using the specified join type.default <Y> FromStream<Y,jakarta.persistence.criteria.From<X, Y>> join(jakarta.persistence.metamodel.SingularAttribute<? super X, Y> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.Join<X, Y>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a singular join to this stream using the specified join type and ON condition.limit(int maxSize) Return this stream truncated to the specified maximum length.default <K,V, M extends Map<K, V>>
ExprStream<M,jakarta.persistence.criteria.Expression<M>> Map this stream to an associated map property.default <E,C extends Collection<E>>
ExprStream<C,jakarta.persistence.criteria.Expression<C>> Map this stream to an associated collection property.default <Y> PathStream<Y,jakarta.persistence.criteria.Path<Y>> Map this stream to an associated property.default <Y> ExprStream<Y,jakarta.persistence.criteria.Expression<Y>> map(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Expression<Y>> exprFunction) Map this stream into a stream whose elements are the result of applying the given function.default DoubleStreammapToDouble(jakarta.persistence.metamodel.SingularAttribute<? super X, ? extends Number> attribute) Map this stream to an associated floating point value.default DoubleStreammapToDouble(Function<? super S, ? extends jakarta.persistence.criteria.Expression<? extends Number>> doubleExprFunction) Map this stream into a stream of double values that are the result of applying the given function.default <Y> ExprStream<Y,jakarta.persistence.criteria.Expression<Y>> mapToExpr(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Expression<Y>> exprFunction) Map this stream into a stream whose elements are the result of applying the given function.default <Z,Y> FromStream<Y, jakarta.persistence.criteria.From<Z, Y>> mapToFrom(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.From<Z, Y>> fromFunction) Map this stream into a stream whose elements are the result of applying the given function.default IntStreamMap this stream to an associated integer value.default IntStreammapToInt(Function<? super S, ? extends jakarta.persistence.criteria.Expression<? extends Number>> intExprFunction) Map this stream into a stream of integer values that are the result of applying the given function.default LongStreamMap this stream to an associated long value.default LongStreammapToLong(Function<? super S, ? extends jakarta.persistence.criteria.Expression<? extends Number>> longExprFunction) Map this stream into a stream of long values that are the result of applying the given function.default <Y> PathStream<Y,jakarta.persistence.criteria.Path<Y>> mapToPath(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Path<Y>> pathFunction) Map this stream into a stream whose elements are the result of applying the given function.default <Y> ExprStream<Y,jakarta.persistence.criteria.Expression<Y>> Map this stream to a stream whose elements are bound to the supplied expression reference.default <Y> FromStream<Y,jakarta.persistence.criteria.From<?, Y>> Map this stream to a stream whose elements are bound to the supplied from reference.default <Y> PathStream<Y,jakarta.persistence.criteria.Path<Y>> Map this stream to a stream whose elements are bound to the supplied path reference.default <Y> RootStream<Y>Map this stream to a stream whose elements are bound to the supplied root reference.default <Y> RootStream<Y>mapToRoot(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Root<Y>> rootFunction) Map this stream into a stream whose elements are the result of applying the given function.default <Y> SearchStream<Y,jakarta.persistence.criteria.Selection<Y>> mapToSelection(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Selection<Y>> selectionFunction) Map this stream into a stream whose elements are the result of applying the given function.booleanExecute this query and return true if no results are found for which the given property is true.booleannoneMatch(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder) Execute this query and return true if no result are found for which the predicate returned by the given function is true.orderBy(jakarta.persistence.criteria.Order... orders) Order results using the specifiedOrders.Order results using the specified property.orderBy(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute1, boolean asc1, jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute2, boolean asc2) Order results using the specified properties.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) Order results using the specified properties.orderBy(Function<? super S, ? extends jakarta.persistence.criteria.Expression<?>> orderExprFunction, boolean asc) Order results using theExpressionproduced by the givenFunction.Order results using the specified expression reference.orderByMulti(Function<? super S, ? extends List<? extends jakarta.persistence.criteria.Order>> orderListFunction) Order results using theOrderlist produced by the givenFunction.Peek at the items in this stream.skip(int num) Return this stream with the specified number of initial elements skipped.thenOrderBy(jakarta.persistence.criteria.Order... orders) Order results using the specifiedOrders after existing sort.thenOrderBy(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute, boolean asc) Order results using the specified property after existing sort.thenOrderBy(Function<? super S, ? extends jakarta.persistence.criteria.Expression<?>> orderExprFunction, boolean asc) Order results using theExpressionproduced by the givenFunctionafter existing sort.thenOrderBy(Ref<?, ? extends jakarta.persistence.criteria.Expression<?>> ref, boolean asc) Order results using the specified expression reference after existing sort.withFetchGraph(String name) Configure a fetch graph for this query.withFlushMode(jakarta.persistence.FlushModeType flushMode) Set theFlushModeTypeassociated with this query.Associate a hint with this query.Associate hints with this query.withLoadGraph(String name) Configure a load graph for this query.withLockMode(jakarta.persistence.LockModeType lockMode) Set theLockModeTypeassociated with this query.withParam(jakarta.persistence.Parameter<Calendar> parameter, Calendar value, jakarta.persistence.TemporalType temporalType) Bind the value of a query parameter of typeCalendar.withParam(jakarta.persistence.Parameter<Date> parameter, Date value, jakarta.persistence.TemporalType temporalType) Bind the value of a query parameter of typeDate.<T> SearchStream<X,S> withParam(jakarta.persistence.Parameter<T> parameter, T value) Bind the value of a query parameter.withParams(Iterable<? extends ParamBinding<?>> params) Associate parameter bindings with this query.Methods inherited from interface org.dellroad.querystream.jpa.QueryConfigurer
configureMethods inherited from interface org.dellroad.querystream.jpa.QueryStream
getEntityManager, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParams, toCriteriaQuery, toQuery
-
Method Details
-
getResultList
Build and evaluate a JPA query based on this instance and return the result list.Delegates to
TypedQuery.getResultList()and can throw any exception thrown by that method.- Returns:
- result of executed query
- See Also:
-
TypedQuery.getResultList()
-
getResultStream
Build and evaluate a JPA query based on this instance and return the result stream.Delegates to
TypedQuery.getResultStream()and can throw any exception thrown by that method.- Returns:
- result of executed query
- See Also:
-
TypedQuery.getResultStream()
-
distinct
SearchStream<X,S> distinct()Suppress duplicates.- Returns:
- a new stream with duplicates removed
-
orderBy
SearchStream<X,S> orderBy(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute, boolean asc) Order results using the specified property.Replaces any existing sort ordering.
- Parameters:
attribute- associated propertyasc- true for ascending, false for descending- Returns:
- a new stream with specified ordering
- Throws:
IllegalArgumentException- ifattributeis null
-
orderBy
SearchStream<X,S> orderBy(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute1, boolean asc1, jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute2, boolean asc2) Order results using the specified properties.Replaces any existing sort ordering.
- Parameters:
attribute1- associated propertyasc1- true forattribute1ascending, false forattribute1descendingattribute2- associated propertyasc2- true forattribute2ascending, false forattribute2descending- Returns:
- a new stream with specified ordering
- Throws:
IllegalArgumentException- ifattribute1orattribute2is null
-
orderBy
SearchStream<X,S> 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) Order results using the specified properties.Replaces any existing sort ordering.
- Parameters:
attribute1- associated propertyasc1- true forattribute1ascending, false forattribute1descendingattribute2- associated propertyasc2- true forattribute2ascending, false forattribute2descendingattribute3- associated propertyasc3- true forattribute3ascending, false forattribute3descending- Returns:
- a new stream with specified ordering
- Throws:
IllegalArgumentException- ifattribute1,attribute2, orattribute3is null
-
orderBy
SearchStream<X,S> orderBy(Ref<?, ? extends jakarta.persistence.criteria.Expression<?>> ref, boolean asc) Order results using the specified expression reference.Replaces any existing sort ordering.
- Parameters:
ref- previously bound expression referenceasc- true for ascending, false for descending- Returns:
- a new stream with specified ordering
- Throws:
IllegalArgumentException- ifrefis null
-
orderBy
Order results using the specifiedOrders.Replaces any existing sort ordering.
- Parameters:
orders- ordering(s), with higher precedence orderings first- Returns:
- a new stream with specified ordering(s)
- Throws:
IllegalArgumentException- ifordersis null
-
orderBy
SearchStream<X,S> orderBy(Function<? super S, ? extends jakarta.persistence.criteria.Expression<?>> orderExprFunction, boolean asc) Order results using theExpressionproduced by the givenFunction.Replaces any existing sort ordering.
- Parameters:
orderExprFunction-Functionthat produces anExpressionto order on given an item expressionasc- true for ascending, false for descending- Returns:
- a new stream with specified ordering
- Throws:
IllegalArgumentException- iforderExprFunctionis null
-
orderByMulti
SearchStream<X,S> orderByMulti(Function<? super S, ? extends List<? extends jakarta.persistence.criteria.Order>> orderListFunction) Order results using theOrderlist produced by the givenFunction.Replaces any existing sort ordering.
- Parameters:
orderListFunction-Functionthat produces the sort ordering given an item expression- Returns:
- a new stream with specified ordering
- Throws:
IllegalArgumentException- iforderListFunctionis null
-
thenOrderBy
SearchStream<X,S> thenOrderBy(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute, boolean asc) Order results using the specified property after existing sort.Adds to any existing sort ordering.
- Parameters:
attribute- associated propertyasc- true for ascending, false for descending- Returns:
- a new stream with specified additional ordering
- Throws:
IllegalArgumentException- ifattributeis null
-
thenOrderBy
SearchStream<X,S> thenOrderBy(Ref<?, ? extends jakarta.persistence.criteria.Expression<?>> ref, boolean asc) Order results using the specified expression reference after existing sort.Adds to any existing sort ordering.
- Parameters:
ref- previously bound expression referenceasc- true for ascending, false for descending- Returns:
- a new stream with specified additional ordering
- Throws:
IllegalArgumentException- ifrefis null
-
thenOrderBy
Order results using the specifiedOrders after existing sort.Adds to any existing sort ordering.
- Parameters:
orders- ordering(s), with higher precedence orderings first- Returns:
- a new stream with specified additional ordering(s)
- Throws:
IllegalArgumentException- ifordersis null
-
thenOrderBy
SearchStream<X,S> thenOrderBy(Function<? super S, ? extends jakarta.persistence.criteria.Expression<?>> orderExprFunction, boolean asc) Order results using theExpressionproduced by the givenFunctionafter existing sort.Adds to any existing sort ordering.
- Parameters:
orderExprFunction-Functionthat produces anExpressionto order on given an item expressionasc- true for ascending, false for descending- Returns:
- a new stream with specified additional ordering
- Throws:
IllegalArgumentException- iforderExprFunctionis null
-
groupBy
Apply grouping based on an expression reference.Adds to any previously specified groupings.
- Parameters:
ref- previously bound expression reference- Returns:
- a new stream with additional grouping
- Throws:
IllegalArgumentException- ifrefis null
-
groupBy
Apply grouping based on the specified property.Adds to any previously specified groupings.
- Parameters:
attribute- associated property- Returns:
- a new stream with additional grouping
- Throws:
IllegalArgumentException- ifattributeis null
-
groupBy
SearchStream<X,S> groupBy(Function<? super S, ? extends jakarta.persistence.criteria.Expression<?>> groupFunction) Apply grouping based on a single expression.Adds to any previously specified groupings.
- Parameters:
groupFunction- function returning an expression by which to group results- Returns:
- a new stream with additional grouping
- Throws:
IllegalArgumentException- ifgroupFunctionis null
-
groupByMulti
SearchStream<X,S> groupByMulti(Function<? super S, ? extends List<jakarta.persistence.criteria.Expression<?>>> groupFunction) Apply grouping based on a list of expressions.Adds to any previously specified groupings.
- Parameters:
groupFunction- function returning a list of expressions by which to group results- Returns:
- a new instance
- Throws:
IllegalArgumentException- ifgroupFunctionis null
-
having
SearchStream<X,S> having(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> havingFunction) Add a "having" restriction.Adds to any previously specified "having" restrictions.
- Parameters:
havingFunction- function returning a test to apply to grouped results- Returns:
- a new instance
- Throws:
IllegalArgumentException- ifhavingFunctionis null
-
allMatch
Execute this query and return true if the given property is true for every resulting item.Delegates to
TypedQuery.getResultStream()and can throw any exception thrown by that method.- Parameters:
attribute- boolean property- Returns:
- true if all results have the given property true
-
allMatch
boolean allMatch(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder) Execute this query and return true if the predicate returned by the given function is true for every resulting item.Delegates to
TypedQuery.getResultStream()and can throw any exception thrown by that method.- Parameters:
predicateBuilder- function mapping this stream's item to a booleanExpression- Returns:
- true if all results have the computed expression true
-
anyMatch
Execute this query and return true if any results are found for which the given property is true.Delegates to
TypedQuery.getResultStream()and can throw any exception thrown by that method.- Parameters:
attribute- boolean property- Returns:
- true if one or more results have the given property true
-
anyMatch
boolean anyMatch(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder) Execute this query and return true if any results are found for which the predicate returned by the given function is true.Delegates to
TypedQuery.getResultStream()and can throw any exception thrown by that method.- Parameters:
predicateBuilder- function mapping this stream's item to a booleanExpression- Returns:
- true if one or more results have the computed expression true
-
noneMatch
Execute this query and return true if no results are found for which the given property is true.Delegates to
TypedQuery.getResultStream()and can throw any exception thrown by that method.- Parameters:
attribute- boolean property- Returns:
- true if no results have the given property true
-
noneMatch
boolean noneMatch(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder) Execute this query and return true if no result are found for which the predicate returned by the given function is true.Delegates to
TypedQuery.getResultStream()and can throw any exception thrown by that method.- Parameters:
predicateBuilder- function mapping this stream's item to a booleanExpression- Returns:
- true if no results have the computed expression true
-
isEmpty
boolean isEmpty()Execute this query and return true if no results are found.Note: to perform an "exists" operation in a subquery, use
ExprStream.exists().Delegates to
TypedQuery.getResultStream()and can throw any exception thrown by that method.- Returns:
- true if no results are found, false if one or more results are found
- See Also:
-
findAny
SearchValue<X,S> findAny()Find any instance in the stream.- Returns:
- single-valued stream containg any instance in this stream (or
NULLif this stream is empty)
-
findFirst
SearchValue<X,S> findFirst()Find the first instance in the stream.- Returns:
- single-valued stream containg the first instance in this stream (or
NULLif this stream is empty)
-
findSingle
SearchValue<X,S> findSingle()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"
SearchValuemethods such asvalue()ortoOptional()will generate aNonUniqueResultException.Using this method is preferable to using
findFirst()orfindAny()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);- Returns:
- a single value, either the only instance in this stream or null if this stream is empty
-
addRoot
<R> SearchStream<X,S> addRoot(Ref<R, ? super jakarta.persistence.criteria.Root<R>> ref, Class<R> type) Bind an unbound reference to a new query root that will be added to the query.To select the new root in a
SearchStream, useSearchStream.map(), providing aFunctionthat returnsref.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.- Type Parameters:
R- type of the new query root- Parameters:
ref- unbound referencetype- type of the new query root- Returns:
- new stream that binds
refto a new query root fromtype - Throws:
IllegalArgumentException- ifrefis already boundIllegalArgumentException- iftypeorrefis null
-
map
default <Y> PathStream<Y,jakarta.persistence.criteria.Path<Y>> map(jakarta.persistence.metamodel.SingularAttribute<? super X, Y> attribute) 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 becausejoin()returns the more specific typeFromStream,join()is preferred over this method when the associated property is an entity.- Type Parameters:
Y- property type- Parameters:
attribute- associated property- Returns:
- mapped stream
-
map
default <Y> ExprStream<Y,jakarta.persistence.criteria.Expression<Y>> map(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Expression<Y>> exprFunction) Map this stream into a stream whose elements are the result of applying the given function.- Type Parameters:
Y- mapped expression type- Parameters:
type- new item typeexprFunction- function mapping this stream'sExpressionto aExpression- Returns:
- mapped stream
-
map
default <E,C extends Collection<E>> ExprStream<C,jakarta.persistence.criteria.Expression<C>> map(jakarta.persistence.metamodel.PluralAttribute<? super X, C, E> attribute) Map this stream to an associated collection property.- Type Parameters:
E- collection element typeC- collection type- Parameters:
attribute- associated property- Returns:
- mapped stream
-
map
default <K,V, ExprStream<M,M extends Map<K, V>> jakarta.persistence.criteria.Expression<M>> map(jakarta.persistence.metamodel.MapAttribute<? super X, K, V> attribute) Map this stream to an associated map property.- Type Parameters:
K- map key typeV- map value typeM- map type- Parameters:
attribute- associated property- Returns:
- mapped stream
-
mapToExpr
default <Y> ExprStream<Y,jakarta.persistence.criteria.Expression<Y>> mapToExpr(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Expression<Y>> exprFunction) Map this stream into a stream whose elements are the result of applying the given function.- Type Parameters:
Y- mapped target type- Parameters:
type- new item typeexprFunction- function mapping this stream'sSelectionto anExpression- Returns:
- mapped stream
-
mapToPath
default <Y> PathStream<Y,jakarta.persistence.criteria.Path<Y>> mapToPath(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Path<Y>> pathFunction) Map this stream into a stream whose elements are the result of applying the given function.- Type Parameters:
Y- mapped expresssion type- Parameters:
type- new item typepathFunction- function mapping this stream'sSelectionto aPath- Returns:
- mapped stream
-
mapToFrom
default <Z,Y> FromStream<Y,jakarta.persistence.criteria.From<Z, mapToFromY>> (Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.From<Z, Y>> fromFunction) Map this stream into a stream whose elements are the result of applying the given function.- Type Parameters:
Z- mapped source typeY- mapped target type- Parameters:
type- new item typefromFunction- function mapping this stream'sSelectionto aFrom- Returns:
- mapped stream
-
mapToRoot
default <Y> RootStream<Y> mapToRoot(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Root<Y>> rootFunction) Map this stream into a stream whose elements are the result of applying the given function.- Type Parameters:
Y- mapped target type- Parameters:
type- new item typerootFunction- function mapping this stream'sSelectionto aRoot- Returns:
- mapped stream
-
mapToRef
Map this stream to a stream whose elements are bound to the supplied root reference.- Type Parameters:
Y- selection type- Parameters:
ref- previously bound root reference- Returns:
- mapped stream
-
mapToRef
default <Y> FromStream<Y,jakarta.persistence.criteria.From<?, mapToRefY>> (Class<Y> type, FromRef<Y> ref) Map this stream to a stream whose elements are bound to the supplied from reference.- Type Parameters:
Y- mapped target type- Parameters:
ref- previously bound from reference- Returns:
- mapped stream
-
mapToRef
default <Y> PathStream<Y,jakarta.persistence.criteria.Path<Y>> mapToRef(Class<Y> type, PathRef<Y> ref) Map this stream to a stream whose elements are bound to the supplied path reference.- Type Parameters:
Y- mapped target type- Parameters:
ref- previously bound path reference- Returns:
- mapped stream
-
mapToRef
default <Y> ExprStream<Y,jakarta.persistence.criteria.Expression<Y>> mapToRef(Class<Y> type, ExprRef<Y> ref) Map this stream to a stream whose elements are bound to the supplied expression reference.- Type Parameters:
Y- mapped target type- Parameters:
ref- previously bound expression reference- Returns:
- mapped stream
-
mapToDouble
default DoubleStream mapToDouble(jakarta.persistence.metamodel.SingularAttribute<? super X, ? extends Number> attribute) Map this stream to an associated floating point value.- Parameters:
attribute- associated numerically-valued property- Returns:
- mapped stream of doubles
-
mapToDouble
default DoubleStream mapToDouble(Function<? super S, ? extends jakarta.persistence.criteria.Expression<? extends Number>> doubleExprFunction) Map this stream into a stream of double values that are the result of applying the given function.- Parameters:
doubleExprFunction- function mapping this stream'sExpressionto a numericalExpression- Returns:
- mapped stream of doubles
-
mapToLong
default LongStream mapToLong(jakarta.persistence.metamodel.SingularAttribute<? super X, ? extends Number> attribute) Map this stream to an associated long value.- Parameters:
attribute- associated numerically-valued property- Returns:
- mapped stream of longs
-
mapToLong
default LongStream mapToLong(Function<? super S, ? extends jakarta.persistence.criteria.Expression<? extends Number>> longExprFunction) Map this stream into a stream of long values that are the result of applying the given function.- Parameters:
longExprFunction- function mapping this stream'sExpressionto a numericalExpression- Returns:
- mapped stream of longs
-
mapToInt
default IntStream mapToInt(jakarta.persistence.metamodel.SingularAttribute<? super X, ? extends Number> attribute) Map this stream to an associated integer value.- Parameters:
attribute- associated numerically-valued property- Returns:
- mapped stream of integers
-
mapToInt
default IntStream mapToInt(Function<? super S, ? extends jakarta.persistence.criteria.Expression<? extends Number>> intExprFunction) Map this stream into a stream of integer values that are the result of applying the given function.- Parameters:
intExprFunction- function mapping this stream'sExpressionto a numericalExpression- Returns:
- mapped stream of integers
-
mapToSelection
default <Y> SearchStream<Y,jakarta.persistence.criteria.Selection<Y>> mapToSelection(Class<Y> type, Function<? super S, ? extends jakarta.persistence.criteria.Selection<Y>> selectionFunction) Map this stream into a stream whose elements are the result of applying the given function.This method provides support for multiple selection using
CriteriaBuilder.array(),CriteriaBuilder.construct(), orCriteriaBuilder.tuple(). For normal single selection, typically you would useSearchStream.map()instead of this method.- Type Parameters:
Y- selection type- Parameters:
type- selection typeselectionFunction- function to build selection- Returns:
- mapped stream
-
flatMap
default <E> FromStream<E,jakarta.persistence.criteria.CollectionJoin<X, flatMapE>> (jakarta.persistence.metamodel.CollectionAttribute<? super X, E> attribute) Map this stream to a stream where every item is replaced with the contents of the specified collection.- Type Parameters:
E- collection element type- Parameters:
attribute- associated collection property- Returns:
- mapped stream
-
flatMap
default <E> FromStream<E,jakarta.persistence.criteria.ListJoin<X, flatMapE>> (jakarta.persistence.metamodel.ListAttribute<? super X, E> attribute) Map this stream to a stream where every item is replaced with the contents of the specified collection.- Type Parameters:
E- list element type- Parameters:
attribute- associated collection property- Returns:
- mapped stream
-
flatMap
default <E> FromStream<E,jakarta.persistence.criteria.SetJoin<X, flatMapE>> (jakarta.persistence.metamodel.SetAttribute<? super X, E> attribute) Map this stream to a stream where every item is replaced with the contents of the specified collection.- Type Parameters:
E- set element type- Parameters:
attribute- associated collection property- Returns:
- mapped stream
-
flatMapKeys
default <K> PathStream<K,jakarta.persistence.criteria.Path<K>> flatMapKeys(jakarta.persistence.metamodel.MapAttribute<? super X, K, ?> attribute) Map this stream to a stream where every item is replaced with the keys of the specified map.- Type Parameters:
K- map key type- Parameters:
attribute- associated map property- Returns:
- mapped stream
-
flatMapValues
default <V> PathStream<V,jakarta.persistence.criteria.Path<V>> flatMapValues(jakarta.persistence.metamodel.MapAttribute<? super X, ?, V> attribute) Map this stream to a stream where every item is replaced with the values of the specified map.- Type Parameters:
V- map value type- Parameters:
attribute- associated map property- Returns:
- mapped stream
-
join
default <Y> FromStream<Y,jakarta.persistence.criteria.From<X, joinY>> (jakarta.persistence.metamodel.SingularAttribute<? super X, Y> attribute) Add a singular inner join to this stream.Equivalent to
join(attribute, JoinType.INNER).- Type Parameters:
Y- associated property type- Parameters:
attribute- associated property- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- ifattributeis null
-
join
default <Y> FromStream<Y,jakarta.persistence.criteria.From<X, joinY>> (jakarta.persistence.metamodel.SingularAttribute<? super X, Y> attribute, jakarta.persistence.criteria.JoinType joinType) Add a singular join to this stream using the specified join type.Equivalent to
join(attribute, JoinType.INNER, join -> null).- Type Parameters:
Y- associated property type- Parameters:
attribute- associated propertyjoinType- type of join- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if either parameter is null
-
join
default <Y> FromStream<Y,jakarta.persistence.criteria.From<X, joinY>> (jakarta.persistence.metamodel.SingularAttribute<? super X, Y> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.Join<X, Y>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a singular join to this stream using the specified join type and ON condition.- Type Parameters:
Y- associated property type- Parameters:
attribute- associated propertyjoinType- type of joinon- function returning a join ON condition, or returning null for none- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if any parameter is null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.CollectionJoin<X, joinE>> (jakarta.persistence.metamodel.CollectionAttribute<? super X, E> attribute) Add a collection inner join to this stream.Equivalent to
join(attribute, JoinType.INNER).- Type Parameters:
E- collection element type- Parameters:
attribute- associated property- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- ifattributeis null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.CollectionJoin<X, joinE>> (jakarta.persistence.metamodel.CollectionAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType) Add a collection join to this stream using the specified join type.Equivalent to
join(attribute, JoinType.INNER, join -> null).- Type Parameters:
E- collection element type- Parameters:
attribute- associated propertyjoinType- type of join- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if either parameter is null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.CollectionJoin<X, joinE>> (jakarta.persistence.metamodel.CollectionAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.CollectionJoin<X, E>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a collection join to this stream using the specified join type and ON condition.- Type Parameters:
E- collection element type- Parameters:
attribute- associated propertyjoinType- type of joinon- function returning a join ON condition, or returning null for none- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if any parameter is null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.ListJoin<X, joinE>> (jakarta.persistence.metamodel.ListAttribute<? super X, E> attribute) Add a list inner join to this stream.Equivalent to
join(attribute, JoinType.INNER).- Type Parameters:
E- list element type- Parameters:
attribute- associated property- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- ifattributeis null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.ListJoin<X, joinE>> (jakarta.persistence.metamodel.ListAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType) Add a list join to this stream using the specified join type.Equivalent to
join(attribute, JoinType.INNER, join -> null).- Type Parameters:
E- list element type- Parameters:
attribute- associated propertyjoinType- type of join- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if either parameter is null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.ListJoin<X, joinE>> (jakarta.persistence.metamodel.ListAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.ListJoin<X, E>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a list join to this stream using the specified join type and ON condition.- Type Parameters:
E- list element type- Parameters:
attribute- associated propertyjoinType- type of joinon- function returning a join ON condition, or returning null for none- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if any parameter is null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.SetJoin<X, joinE>> (jakarta.persistence.metamodel.SetAttribute<? super X, E> attribute) Add a set inner join to this stream.Equivalent to
join(attribute, JoinType.INNER).- Type Parameters:
E- set element type- Parameters:
attribute- associated property- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- ifattributeis null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.SetJoin<X, joinE>> (jakarta.persistence.metamodel.SetAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType) Add a set join to this stream using the specified join type.Equivalent to
join(attribute, JoinType.INNER, join -> null).- Type Parameters:
E- set element type- Parameters:
attribute- associated propertyjoinType- type of join- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if either parameter is null
-
join
default <E> FromStream<E,jakarta.persistence.criteria.SetJoin<X, joinE>> (jakarta.persistence.metamodel.SetAttribute<? super X, E> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.SetJoin<X, E>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a set join to this stream using the specified join type and ON condition.- Type Parameters:
E- set element type- Parameters:
attribute- associated propertyjoinType- type of joinon- function returning a join ON condition, or returning null for none- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if any parameter is null
-
join
default <K,V> FromStream<V,jakarta.persistence.criteria.MapJoin<X, joinK, V>> (jakarta.persistence.metamodel.MapAttribute<? super X, K, V> attribute) Add a map inner join to this stream.Equivalent to
join(attribute, JoinType.INNER).- Type Parameters:
K- map key typeV- map value type- Parameters:
attribute- associated property- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- ifattributeis null
-
join
default <K,V> FromStream<V,jakarta.persistence.criteria.MapJoin<X, joinK, V>> (jakarta.persistence.metamodel.MapAttribute<? super X, K, V> attribute, jakarta.persistence.criteria.JoinType joinType) Add a map join to this stream using the specified join type.Equivalent to
join(attribute, JoinType.INNER, join -> null).- Type Parameters:
K- map key typeV- map value type- Parameters:
attribute- associated propertyjoinType- type of join- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if either parameter is null
-
join
default <K,V> FromStream<V,jakarta.persistence.criteria.MapJoin<X, joinK, V>> (jakarta.persistence.metamodel.MapAttribute<? super X, K, V> attribute, jakarta.persistence.criteria.JoinType joinType, Function<? super jakarta.persistence.criteria.MapJoin<X, K, V>, ? extends jakarta.persistence.criteria.Expression<Boolean>> on) Add a map join to this stream using the specified join type and ON condition.- Type Parameters:
K- map key typeV- map value type- Parameters:
attribute- associated propertyjoinType- type of joinon- function returning a join ON condition, or returning null for none- Returns:
- a new stream with specified join
- Throws:
IllegalArgumentException- if any parameter is null
-
fetch
Add a singular fetch inner join to this stream.Equivalent to
fetch(attribute, JoinType.INNER).- Parameters:
attribute- associated property- Returns:
- a new stream with specified inner fetch join
- Throws:
IllegalArgumentException- ifattributeis null
-
fetch
SearchStream<X,S> fetch(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute, jakarta.persistence.criteria.JoinType joinType) 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.- Parameters:
attribute- associated propertyjoinType- join type- Returns:
- a new stream with specified fetch join
- Throws:
IllegalArgumentException- if either parameter is null
-
fetch
Add a plural fetch join to this stream.Equivalent to
fetch(attribute, JoinType.INNER).- Parameters:
attribute- associated property- Returns:
- a new stream with specified inner fetch join
- Throws:
IllegalArgumentException- ifattributeis null
-
fetch
SearchStream<X,S> fetch(jakarta.persistence.metamodel.PluralAttribute<? super X, ?, ?> attribute, jakarta.persistence.criteria.JoinType joinType) 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.- Parameters:
attribute- associated propertyjoinType- join type- Returns:
- a new stream with specified fetch join
- Throws:
IllegalArgumentException- if either parameter is null
-
getQueryType
SearchType<X> getQueryType()Description copied from interface:QueryStreamGet theQueryTypeof this instance.- Specified by:
getQueryTypein interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Returns:
- associated
QueryType
-
bind
Description copied from interface:QueryStreamBind an unbound reference to the items in this stream. -
peek
Description copied from interface:QueryStreamPeek at the items in this stream.This is useful in cases where the selection can be modified, e.g., setting join
ONconditions usingJoin.on().- Specified by:
peekin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
peeker- peeker into stream- Returns:
- new stream that peeks into this stream
-
bind
<X2,S2 extends jakarta.persistence.criteria.Selection<X2>> SearchStream<X,S> bind(Ref<X2, ? super S2> ref, Function<? super S, ? extends S2> refFunction) Description copied from interface:QueryStreamBind an unbound reference to the result of applying the given function to the items in this stream.- Specified by:
bindin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Type Parameters:
X2- type of the bound valueS2- criteria type of the bound value- Parameters:
ref- unbound referencerefFunction- function mapping this stream'sSelectionto the reference value- Returns:
- new stream that binds
ref
-
filter
SearchStream<X,S> filter(jakarta.persistence.metamodel.SingularAttribute<? super X, Boolean> attribute) Description copied from interface:QueryStreamFilter results using the specified boolean property.Adds to any previously specified filters.
-
filter
SearchStream<X,S> filter(Function<? super S, ? extends jakarta.persistence.criteria.Expression<Boolean>> predicateBuilder) Description copied from interface:QueryStreamFilter results using the boolean expression produced by the given function.Adds to any previously specified filters.
- Specified by:
filterin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
predicateBuilder- function mapping this stream's item to a booleanExpression- Returns:
- new filtered stream
-
limit
Description copied from interface:QueryStreamReturn 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:
limitin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
maxSize- maximum number of elements to return- Returns:
- new truncated stream
-
skip
Description copied from interface:QueryStreamReturn 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.).
-
withFlushMode
Description copied from interface:QueryStreamSet theFlushModeTypeassociated with this query.- Specified by:
withFlushModein interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
flushMode- new flush mode- Returns:
- new stream with the specified flush mode configured
- See Also:
-
Query.setFlushMode(jakarta.persistence.FlushModeType)
-
withLockMode
Description copied from interface:QueryStreamSet theLockModeTypeassociated with this query.- Specified by:
withLockModein interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
lockMode- new lock mode- Returns:
- new stream with the specified lock mode configured
- See Also:
-
Query.setLockMode(jakarta.persistence.LockModeType)
-
withHint
Description copied from interface:QueryStreamAssociate a hint with this query.- Specified by:
withHintin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
name- name of hintvalue- value of hint- Returns:
- new stream with the specified hint configured
- See Also:
-
Query.setHint(java.lang.String, java.lang.Object)
-
withHints
Description copied from interface:QueryStreamAssociate hints with this query.- Specified by:
withHintsin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<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
Description copied from interface:QueryStreamBind the value of a query parameter.Replaces any previous binding of the same parameter.
- Specified by:
withParamin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Type Parameters:
T- parameter value type- Parameters:
parameter- the parameter to setvalue- parameter value- Returns:
- new stream with the specified parameter value set
- See Also:
-
Query.setParameter(Parameter, Object)
-
withParam
SearchStream<X,S> withParam(jakarta.persistence.Parameter<Date> parameter, Date value, jakarta.persistence.TemporalType temporalType) Description copied from interface:QueryStreamBind the value of a query parameter of typeDate.Replaces any previous binding of the same parameter.
- Specified by:
withParamin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
parameter- the parameter to setvalue- parameter valuetemporalType- temporal type forvalue- Returns:
- new stream with the specified parameter value set
- See Also:
-
Query.setParameter(Parameter, Date, TemporalType)
-
withParam
SearchStream<X,S> withParam(jakarta.persistence.Parameter<Calendar> parameter, Calendar value, jakarta.persistence.TemporalType temporalType) Description copied from interface:QueryStreamBind the value of a query parameter of typeCalendar.Replaces any previous binding of the same parameter.
- Specified by:
withParamin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
parameter- the parameter to setvalue- parameter valuetemporalType- temporal type forvalue- Returns:
- new stream with the specified parameter value set
- See Also:
-
Query.setParameter(Parameter, Calendar, TemporalType)
-
withParams
Description copied from interface:QueryStreamAssociate parameter bindings with this query.Replaces any previous bindings of the same parameters.
- Specified by:
withParamsin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
params- bindings to add- Returns:
- new stream with the specified parameter bindings added
- See Also:
-
Query.setParameter(Parameter, Object)
-
withLoadGraph
Description copied from interface:QueryStreamConfigure a load graph for this query.Equivalent to
withHint("jakarta.persistence.loadgraph", name).- Specified by:
withLoadGraphin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
name- name of load graph- Returns:
- new stream with the specified load graph configured
-
withFetchGraph
Description copied from interface:QueryStreamConfigure a fetch graph for this query.Equivalent to
withHint("jakarta.persistence.fetchgraph", name).- Specified by:
withFetchGraphin interfaceQueryStream<X,S extends jakarta.persistence.criteria.Selection<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Parameters:
name- name of fetch graph- Returns:
- new stream with the specified fetch graph configured
-