Interface DeleteStream<X>
- All Superinterfaces:
QueryConfigurer<CriteriaDelete<X>,,X, Root<X>> QueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query>
Stream-like API.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.dellroad.querystream.jpa.QueryStream
QueryStream.Builder -
Method Summary
Modifier and TypeMethodDescriptionBind an unbound reference to the items in this stream.<X2,S2 extends Selection<X2>>
DeleteStream<X>Bind an unbound reference to the result of applying the given function to the items in this stream.intdelete()Build and execute a JPA query based on this instance.filter(SingularAttribute<? super X, Boolean> attribute) Filter results using the specified boolean property.Filter results using the boolean expression produced by the given function.Get theQueryTypeof this instance.limit(int maxSize) Return this stream truncated to the specified maximum length.Peek at the items in this stream.skip(int num) Return this stream with the specified number of initial elements skipped.withFetchGraph(String name) Configure a fetch graph for this query.withFlushMode(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(LockModeType lockMode) Set theLockModeTypeassociated 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> DeleteStream<X>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
-
delete
int delete()Build and execute a JPA query based on this instance.Ultimately delegates to
Query.executeUpdate()and can throw any exception thrown by that method.- Returns:
- the number of entities deleted
-
getQueryType
DeleteType<X> getQueryType()Description copied from interface:QueryStreamGet theQueryTypeof this instance.- Specified by:
getQueryTypein interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Returns:
- associated
QueryType
-
bind
Description copied from interface:QueryStreamBind an unbound reference to the items in this stream.- Specified by:
bindin interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
ref- unbound reference- Returns:
- new stream that binds
ref
-
bind
<X2,S2 extends Selection<X2>> DeleteStream<X> bind(Ref<X2, ? super S2> ref, Function<? super 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 interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - 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
-
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,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
peeker- peeker into stream- Returns:
- new stream that peeks into this stream
-
filter
Description copied from interface:QueryStreamFilter results using the specified boolean property.Adds to any previously specified filters.
- Specified by:
filterin interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
attribute- boolean property- Returns:
- new filtered stream
-
filter
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,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - 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,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - 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 interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
num- number of elements to skip- Returns:
- new elided stream
-
withFlushMode
Description copied from interface:QueryStreamSet theFlushModeTypeassociated with this query.- Specified by:
withFlushModein interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
flushMode- new flush mode- Returns:
- new stream with the specified flush mode configured
- See Also:
-
withLockMode
Description copied from interface:QueryStreamSet theLockModeTypeassociated with this query.- Specified by:
withLockModein interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
lockMode- new lock mode- Returns:
- new stream with the specified lock mode configured
- See Also:
-
withHint
Description copied from interface:QueryStreamAssociate a hint with this query.- Specified by:
withHintin interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
name- name of hintvalue- value of hint- Returns:
- new stream with the specified hint configured
- See Also:
-
withHints
Description copied from interface:QueryStreamAssociate hints with this query.- Specified by:
withHintsin interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
hints- hints to add- Returns:
- new stream with the specified hints added
- See Also:
-
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,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - 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:QueryStreamBind the value of a query parameter of typeDate.Replaces any previous binding of the same parameter.
- Specified by:
withParamin interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - 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:QueryStreamBind the value of a query parameter of typeCalendar.Replaces any previous binding of the same parameter.
- Specified by:
withParamin interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - 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:QueryStreamAssociate parameter bindings with this query.Replaces any previous bindings of the same parameters.
- Specified by:
withParamsin interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
params- bindings to add- Returns:
- new stream with the specified parameter bindings added
- See Also:
-
withLoadGraph
Description copied from interface:QueryStreamConfigure a load graph for this query.Equivalent to
withHint("jakarta.persistence.loadgraph", name).- Specified by:
withLoadGraphin interfaceQueryStream<X,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - 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,Root<X>, CriteriaDelete<X>, CriteriaDelete<X>, Query> - Parameters:
name- name of fetch graph- Returns:
- new stream with the specified fetch graph configured
-