Package org.dellroad.querystream.jpa
Interface BooleanValue
- All Superinterfaces:
ExprStream<Boolean,
,Expression<Boolean>> ExprValue<Boolean,
,Expression<Boolean>> QueryConfigurer<AbstractQuery<?>,
,Boolean, Expression<Boolean>> QueryStream<Boolean,
,Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> SearchStream<Boolean,
,Expression<Boolean>> SearchValue<Boolean,
Expression<Boolean>>
A boolean
ExprValue
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.dellroad.querystream.jpa.QueryStream
QueryStream.Builder
-
Method Summary
Modifier and TypeMethodDescriptionbind
(Ref<Boolean, ? super Expression<Boolean>> ref) Bind an unbound reference to the items in this stream.default boolean
Build and evaluate a JPA query based on this instance and return the single non-NULL result.filter
(Function<? super Expression<Boolean>, ? extends Expression<Boolean>> predicateBuilder) Filter results using the boolean expression produced by the given function.not()
Invert this instance.peek
(Consumer<? super Expression<Boolean>> peeker) Peek at the items in this stream.withFetchGraph
(String name) Configure a fetch graph for this query.withFlushMode
(FlushModeType flushMode) Set theFlushModeType
associated 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
(LockModeType lockMode) Set theLockModeType
associated with this query.withParam
(Parameter<Calendar> parameter, Calendar value, TemporalType temporalType) Bind the value of a query parameter of typeCalendar
.withParam
(Parameter<Date> parameter, Date value, TemporalType temporalType) Bind the value of a query parameter of typeDate
.<T> BooleanValue
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
addRoot, asSubquery, count, countDistinct, distinct, exists, fetch, fetch, fetch, fetch, findAny, findFirst, findSingle, groupBy, groupBy, groupBy, groupByMulti, having, limit, orderBy, orderBy, orderBy, orderBy, orderBy, orderBy, orderByMulti, skip, thenOrderBy, thenOrderBy, thenOrderBy, thenOrderBy
Methods inherited from interface org.dellroad.querystream.jpa.ExprValue
bind, filter, map, map, map, map, mapToDouble, mapToDouble, mapToExpr, mapToFrom, mapToInt, mapToInt, mapToLong, mapToLong, mapToPath
Methods inherited from interface org.dellroad.querystream.jpa.QueryConfigurer
configure
Methods inherited from interface org.dellroad.querystream.jpa.QueryStream
getEntityManager, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParams, toCriteriaQuery, toQuery
Methods 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, mapToRef, mapToRef, mapToRef, mapToRef, mapToRoot, noneMatch, noneMatch
Methods inherited from interface org.dellroad.querystream.jpa.SearchValue
ifPresent, isPresent, mapToSelection, orElse, orElseGet, orElseThrow, toOptional, value
-
Method Details
-
not
BooleanValue not()Invert this instance.- Returns:
- inverse value
-
booleanValue
default boolean booleanValue()Build and evaluate a JPA query based on this instance and return the single non-NULL result.This variant of
SearchValue.value()
is useful when it is known that NULL won't be returned.- Returns:
- result of executed query
- Throws:
NoResultException
- if the query returns NULL
-
bind
Description copied from interface:QueryStream
Bind an unbound reference to the items in this stream.- Specified by:
bind
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
bind
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
bind
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
bind
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
bind
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
ref
- unbound reference- Returns:
- new stream that binds
ref
-
peek
Description copied from interface:QueryStream
Peek at the items in this stream.This is useful in cases where the selection can be modified, e.g., setting join
ON
conditions usingJoin.on()
.- Specified by:
peek
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
peek
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
peek
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
peek
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
peek
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
peeker
- peeker into stream- Returns:
- new stream that peeks into this stream
-
filter
BooleanValue filter(Function<? super Expression<Boolean>, ? extends Expression<Boolean>> predicateBuilder) Description copied from interface:QueryStream
Filter results using the boolean expression produced by the given function.Adds to any previously specified filters.
- Specified by:
filter
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
filter
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
filter
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
filter
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
filter
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
predicateBuilder
- function mapping this stream's item to a booleanExpression
- Returns:
- new filtered stream
-
withFlushMode
Description copied from interface:QueryStream
Set theFlushModeType
associated with this query.- Specified by:
withFlushMode
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withFlushMode
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withFlushMode
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withFlushMode
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withFlushMode
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
flushMode
- new flush mode- Returns:
- new stream with the specified flush mode configured
- See Also:
-
withLockMode
Description copied from interface:QueryStream
Set theLockModeType
associated with this query.- Specified by:
withLockMode
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withLockMode
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withLockMode
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withLockMode
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withLockMode
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
lockMode
- new lock mode- Returns:
- new stream with the specified lock mode configured
- See Also:
-
withHint
Description copied from interface:QueryStream
Associate a hint with this query.- Specified by:
withHint
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withHint
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withHint
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withHint
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withHint
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
name
- name of hintvalue
- value of hint- Returns:
- new stream with the specified hint configured
- See Also:
-
withHints
Description copied from interface:QueryStream
Associate hints with this query.- Specified by:
withHints
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withHints
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withHints
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withHints
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withHints
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
hints
- hints to add- Returns:
- new stream with the specified hints added
- See Also:
-
withParam
Description copied from interface:QueryStream
Bind the value of a query parameter.Replaces any previous binding of the same parameter.
- Specified by:
withParam
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withParam
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceSearchValue<Boolean,
Expression<Boolean>> - 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:
-
withParam
Description copied from interface:QueryStream
Bind the value of a query parameter of typeDate
.Replaces any previous binding of the same parameter.
- Specified by:
withParam
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withParam
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
parameter
- the parameter to setvalue
- parameter valuetemporalType
- temporal type forvalue
- Returns:
- new stream with the specified parameter value set
- See Also:
-
withParam
Description copied from interface:QueryStream
Bind the value of a query parameter of typeCalendar
.Replaces any previous binding of the same parameter.
- Specified by:
withParam
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withParam
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withParam
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
parameter
- the parameter to setvalue
- parameter valuetemporalType
- temporal type forvalue
- Returns:
- new stream with the specified parameter value set
- See Also:
-
withParams
Description copied from interface:QueryStream
Associate parameter bindings with this query.Replaces any previous bindings of the same parameters.
- Specified by:
withParams
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withParams
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withParams
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withParams
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withParams
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
params
- bindings to add- Returns:
- new stream with the specified parameter bindings added
- See Also:
-
withLoadGraph
Description copied from interface:QueryStream
Configure a load graph for this query.Equivalent to
withHint
("jakarta.persistence.loadgraph", name)
.- Specified by:
withLoadGraph
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withLoadGraph
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withLoadGraph
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withLoadGraph
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withLoadGraph
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
name
- name of load graph- Returns:
- new stream with the specified load graph configured
-
withFetchGraph
Description copied from interface:QueryStream
Configure a fetch graph for this query.Equivalent to
withHint
("jakarta.persistence.fetchgraph", name)
.- Specified by:
withFetchGraph
in interfaceExprStream<Boolean,
Expression<Boolean>> - Specified by:
withFetchGraph
in interfaceExprValue<Boolean,
Expression<Boolean>> - Specified by:
withFetchGraph
in interfaceQueryStream<Boolean,
Expression<Boolean>, AbstractQuery<?>, CriteriaQuery<Boolean>, TypedQuery<Boolean>> - Specified by:
withFetchGraph
in interfaceSearchStream<Boolean,
Expression<Boolean>> - Specified by:
withFetchGraph
in interfaceSearchValue<Boolean,
Expression<Boolean>> - Parameters:
name
- name of fetch graph- Returns:
- new stream with the specified fetch graph configured
-