- All Superinterfaces:
ExprStream<X,,jakarta.persistence.criteria.Root<X>> FromStream<X,,jakarta.persistence.criteria.Root<X>> PathStream<X,,jakarta.persistence.criteria.Root<X>> QueryConfigurer<jakarta.persistence.criteria.AbstractQuery<?>,,X, jakarta.persistence.criteria.Root<X>> QueryStream<X,,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> SearchStream<X,jakarta.persistence.criteria.Root<X>>
- All Known Subinterfaces:
RootValue<X>
SearchStream containing items representable as Roots.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.dellroad.querystream.jpa.QueryStream
QueryStream.Builder -
Method Summary
Modifier and TypeMethodDescription<R> RootStream<X>Bind an unbound reference to a new query root that will be added to the query.Bind an unbound reference to the items in this stream.<X2,S2 extends jakarta.persistence.criteria.Selection<X2>>
RootStream<X>bind(Ref<X2, ? super S2> ref, Function<? super jakarta.persistence.criteria.Root<X>, ? extends S2> refFunction) Bind an unbound reference to the result of applying the given function to the items in this stream.<Y extends X>
RootStream<Y>Map this stream into a stream whose elements are the result of applying the given narrowing cast.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 jakarta.persistence.criteria.Root<X>, ? 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.Apply grouping based on the specified property.groupBy(Function<? super jakarta.persistence.criteria.Root<X>, ? extends jakarta.persistence.criteria.Expression<?>> groupFunction) Apply grouping based on a single expression.Apply grouping based on an expression reference.groupByMulti(Function<? super jakarta.persistence.criteria.Root<X>, ? extends List<jakarta.persistence.criteria.Expression<?>>> groupFunction) Apply grouping based on a list of expressions.having(Function<? super jakarta.persistence.criteria.Root<X>, ? extends jakarta.persistence.criteria.Expression<Boolean>> havingFunction) Add a "having" restriction.limit(int maxSize) Return this stream truncated to the specified maximum length.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 jakarta.persistence.criteria.Root<X>, ? 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 jakarta.persistence.criteria.Root<X>, ? 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 jakarta.persistence.criteria.Root<X>, ? 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> RootStream<X>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.ExprStream
asSubquery, count, countDistinct, existsMethods 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, toQueryMethods inherited from interface org.dellroad.querystream.jpa.SearchStream
allMatch, 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, map, map, map, map, mapToDouble, mapToDouble, mapToExpr, mapToFrom, mapToInt, mapToInt, mapToLong, mapToLong, mapToPath, mapToRef, mapToRef, mapToRef, mapToRef, mapToRoot, mapToSelection, noneMatch, noneMatch
-
Method Details
-
cast
Description copied from interface:PathStreamMap this stream into a stream whose elements are the result of applying the given narrowing cast.- Specified by:
castin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Type Parameters:
Y- narrower type- Parameters:
type- new, narrower item type- Returns:
- recast stream
- See Also:
-
CriteriaBuilder.treat()
-
distinct
RootStream<X> distinct()Description copied from interface:SearchStreamSuppress duplicates.- Specified by:
distinctin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
distinctin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
distinctin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
distinctin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Returns:
- a new stream with duplicates removed
-
orderBy
Description copied from interface:SearchStreamOrder results using the specified expression reference.Replaces any existing sort ordering.
- Specified by:
orderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
ref- previously bound expression referenceasc- true for ascending, false for descending- Returns:
- a new stream with specified ordering
-
orderBy
RootStream<X> orderBy(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute, boolean asc) Description copied from interface:SearchStreamOrder results using the specified property.Replaces any existing sort ordering.
- Specified by:
orderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute- associated propertyasc- true for ascending, false for descending- Returns:
- a new stream with specified ordering
-
orderBy
RootStream<X> orderBy(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute1, boolean asc1, jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute2, boolean asc2) Description copied from interface:SearchStreamOrder results using the specified properties.Replaces any existing sort ordering.
- Specified by:
orderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute1- associated propertyasc1- true forattribute1ascending, false forattribute1descendingattribute2- associated propertyasc2- true forattribute2ascending, false forattribute2descending- Returns:
- a new stream with specified ordering
-
orderBy
RootStream<X> 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) Description copied from interface:SearchStreamOrder results using the specified properties.Replaces any existing sort ordering.
- Specified by:
orderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - 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
-
orderBy
RootStream<X> orderBy(Function<? super jakarta.persistence.criteria.Root<X>, ? extends jakarta.persistence.criteria.Expression<?>> orderExprFunction, boolean asc) Description copied from interface:SearchStreamOrder results using theExpressionproduced by the givenFunction.Replaces any existing sort ordering.
- Specified by:
orderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
orderExprFunction-Functionthat produces anExpressionto order on given an item expressionasc- true for ascending, false for descending- Returns:
- a new stream with specified ordering
-
orderBy
Description copied from interface:SearchStreamOrder results using the specifiedOrders.Replaces any existing sort ordering.
- Specified by:
orderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
orders- ordering(s), with higher precedence orderings first- Returns:
- a new stream with specified ordering(s)
-
orderByMulti
RootStream<X> orderByMulti(Function<? super jakarta.persistence.criteria.Root<X>, ? extends List<? extends jakarta.persistence.criteria.Order>> orderListFunction) Description copied from interface:SearchStreamOrder results using theOrderlist produced by the givenFunction.Replaces any existing sort ordering.
- Specified by:
orderByMultiin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByMultiin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByMultiin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
orderByMultiin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
orderListFunction-Functionthat produces the sort ordering given an item expression- Returns:
- a new stream with specified ordering
-
thenOrderBy
RootStream<X> thenOrderBy(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute, boolean asc) Description copied from interface:SearchStreamOrder results using the specified property after existing sort.Adds to any existing sort ordering.
- Specified by:
thenOrderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute- associated propertyasc- true for ascending, false for descending- Returns:
- a new stream with specified additional ordering
-
thenOrderBy
RootStream<X> thenOrderBy(Ref<?, ? extends jakarta.persistence.criteria.Expression<?>> ref, boolean asc) Description copied from interface:SearchStreamOrder results using the specified expression reference after existing sort.Adds to any existing sort ordering.
- Specified by:
thenOrderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
ref- previously bound expression referenceasc- true for ascending, false for descending- Returns:
- a new stream with specified additional ordering
-
thenOrderBy
Description copied from interface:SearchStreamOrder results using the specifiedOrders after existing sort.Adds to any existing sort ordering.
- Specified by:
thenOrderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
orders- ordering(s), with higher precedence orderings first- Returns:
- a new stream with specified additional ordering(s)
-
thenOrderBy
RootStream<X> thenOrderBy(Function<? super jakarta.persistence.criteria.Root<X>, ? extends jakarta.persistence.criteria.Expression<?>> orderExprFunction, boolean asc) Description copied from interface:SearchStreamOrder results using theExpressionproduced by the givenFunctionafter existing sort.Adds to any existing sort ordering.
- Specified by:
thenOrderByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
thenOrderByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - 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
-
groupBy
Description copied from interface:SearchStreamApply grouping based on an expression reference.Adds to any previously specified groupings.
- Specified by:
groupByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
ref- previously bound expression reference- Returns:
- a new stream with additional grouping
-
groupBy
Description copied from interface:SearchStreamApply grouping based on the specified property.Adds to any previously specified groupings.
- Specified by:
groupByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute- associated property- Returns:
- a new stream with additional grouping
-
groupBy
RootStream<X> groupBy(Function<? super jakarta.persistence.criteria.Root<X>, ? extends jakarta.persistence.criteria.Expression<?>> groupFunction) Description copied from interface:SearchStreamApply grouping based on a single expression.Adds to any previously specified groupings.
- Specified by:
groupByin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
groupFunction- function returning an expression by which to group results- Returns:
- a new stream with additional grouping
-
groupByMulti
RootStream<X> groupByMulti(Function<? super jakarta.persistence.criteria.Root<X>, ? extends List<jakarta.persistence.criteria.Expression<?>>> groupFunction) Description copied from interface:SearchStreamApply grouping based on a list of expressions.Adds to any previously specified groupings.
- Specified by:
groupByMultiin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByMultiin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByMultiin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
groupByMultiin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
groupFunction- function returning a list of expressions by which to group results- Returns:
- a new instance
-
having
RootStream<X> having(Function<? super jakarta.persistence.criteria.Root<X>, ? extends jakarta.persistence.criteria.Expression<Boolean>> havingFunction) Description copied from interface:SearchStreamAdd a "having" restriction.Adds to any previously specified "having" restrictions.
- Specified by:
havingin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
havingin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
havingin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
havingin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
havingFunction- function returning a test to apply to grouped results- Returns:
- a new instance
-
findAny
Description copied from interface:SearchStreamFind any instance in the stream.- Specified by:
findAnyin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findAnyin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findAnyin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findAnyin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Returns:
- single-valued stream containg any instance in this stream (or
NULLif this stream is empty)
-
findFirst
Description copied from interface:SearchStreamFind the first instance in the stream.- Specified by:
findFirstin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findFirstin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findFirstin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findFirstin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Returns:
- single-valued stream containg the first instance in this stream (or
NULLif this stream is empty)
-
findSingle
Description copied from interface:SearchStreamFind 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
SearchStream.findFirst()orSearchStream.findAny()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);- Specified by:
findSinglein interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findSinglein interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findSinglein interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
findSinglein interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Returns:
- a single value, either the only instance in this stream or null if this stream is empty
-
bind
Description copied from interface:QueryStreamBind an unbound reference to the items in this stream.- Specified by:
bindin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
bindin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
bindin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
bindin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
bindin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
ref- unbound reference- Returns:
- new stream that binds
ref
-
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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
peekin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
peekin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
peekin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
peekin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
peeker- peeker into stream- Returns:
- new stream that peeks into this stream
-
bind
<X2,S2 extends jakarta.persistence.criteria.Selection<X2>> RootStream<X> bind(Ref<X2, ? super S2> ref, Function<? super jakarta.persistence.criteria.Root<X>, ? 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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
bindin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
bindin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
bindin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
bindin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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
-
addRoot
Description copied from interface:SearchStreamBind 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.- Specified by:
addRootin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
addRootin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
addRootin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
addRootin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - 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
-
filter
Description copied from interface:QueryStreamFilter results using the specified boolean property.Adds to any previously specified filters.
- Specified by:
filterin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
filterin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
filterin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
filterin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
filterin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute- boolean property- Returns:
- new filtered stream
-
filter
RootStream<X> filter(Function<? super jakarta.persistence.criteria.Root<X>, ? 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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
filterin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
filterin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
filterin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
filterin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
limitin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
limitin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
limitin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
limitin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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.).
- Specified by:
skipin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
skipin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
skipin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
skipin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
skipin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
num- number of elements to skip- Returns:
- new elided stream
-
withFlushMode
Description copied from interface:QueryStreamSet theFlushModeTypeassociated with this query.- Specified by:
withFlushModein interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withFlushModein interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withFlushModein interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withFlushModein interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withFlushModein interfaceSearchStream<X,jakarta.persistence.criteria.Root<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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withLockModein interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withLockModein interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withLockModein interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withLockModein interfaceSearchStream<X,jakarta.persistence.criteria.Root<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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withHintin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withHintin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withHintin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withHintin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withHintsin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withHintsin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withHintsin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withHintsin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withParamin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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
RootStream<X> 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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withParamin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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
RootStream<X> 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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withParamin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamsin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamsin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withParamsin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withParamsin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withLoadGraphin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withLoadGraphin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withLoadGraphin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withLoadGraphin interfaceSearchStream<X,jakarta.persistence.criteria.Root<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 interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withFetchGraphin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withFetchGraphin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
withFetchGraphin interfaceQueryStream<X,jakarta.persistence.criteria.Root<X>, jakarta.persistence.criteria.AbstractQuery<?>, jakarta.persistence.criteria.CriteriaQuery<X>, jakarta.persistence.TypedQuery<X>> - Specified by:
withFetchGraphin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
name- name of fetch graph- Returns:
- new stream with the specified fetch graph configured
-
fetch
Description copied from interface:SearchStreamAdd a singular fetch inner join to this stream.Equivalent to
fetch(attribute, JoinType.INNER).- Specified by:
fetchin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute- associated property- Returns:
- a new stream with specified inner fetch join
-
fetch
RootStream<X> fetch(jakarta.persistence.metamodel.SingularAttribute<? super X, ?> attribute, jakarta.persistence.criteria.JoinType joinType) Description copied from interface:SearchStreamAdd 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.- Specified by:
fetchin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute- associated propertyjoinType- join type- Returns:
- a new stream with specified fetch join
-
fetch
Description copied from interface:SearchStreamAdd a plural fetch join to this stream.Equivalent to
fetch(attribute, JoinType.INNER).- Specified by:
fetchin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute- associated property- Returns:
- a new stream with specified inner fetch join
-
fetch
RootStream<X> fetch(jakarta.persistence.metamodel.PluralAttribute<? super X, ?, ?> attribute, jakarta.persistence.criteria.JoinType joinType) Description copied from interface:SearchStreamAdd 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.- Specified by:
fetchin interfaceExprStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfaceFromStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfacePathStream<X,jakarta.persistence.criteria.Root<X>> - Specified by:
fetchin interfaceSearchStream<X,jakarta.persistence.criteria.Root<X>> - Parameters:
attribute- associated propertyjoinType- join type- Returns:
- a new stream with specified fetch join
-