public interface UpdateStream<X> extends QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>
Stream-like API.QueryStream.Builder| Modifier and Type | Method and Description |
|---|---|
UpdateStream<X> |
bind(Ref<X,? super Root<X>> ref)
Bind an unbound reference to the items in this stream.
|
<X2,S2 extends Selection<X2>> |
bind(Ref<X2,? super S2> ref,
Function<? super Root<X>,? extends S2> refFunction)
Bind an unbound reference to the result of applying the given function to the items in this stream.
|
UpdateStream<X> |
filter(Function<? super Root<X>,? extends Expression<Boolean>> predicateBuilder)
Filter results using the boolean expression produced by the given function.
|
UpdateStream<X> |
filter(SingularAttribute<? super X,Boolean> attribute)
Filter results using the specified boolean property.
|
UpdateType<X> |
getQueryType()
Get the
QueryType of this instance. |
UpdateStream<X> |
limit(int maxSize)
Return this stream truncated to the specified maximum length.
|
UpdateStream<X> |
peek(Consumer<? super Root<X>> peeker)
Peek at the items in this stream.
|
<Y> UpdateStream<X> |
set(Path<Y> path,
Expression<? extends Y> value)
Set the property described by the specified
Path to the value described by the specified expression. |
<Y> UpdateStream<X> |
set(Path<Y> path,
Function<? super Root<X>,? extends Expression<? extends Y>> expressionBuilder)
Set the property described by the specified
Path using the value expression returned by the given function. |
<Y,V extends Y> |
set(Path<Y> path,
V value)
Set the property described by the specified
Path to the specified value. |
<Y> UpdateStream<X> |
set(SingularAttribute<? super X,Y> attribute,
Expression<? extends Y> value)
Set the property described by the specified attribute to the value described by the specified expression.
|
<Y> UpdateStream<X> |
set(SingularAttribute<? super X,Y> attribute,
Function<? super Root<X>,? extends Expression<? extends Y>> expressionBuilder)
Set the property described by the specified attribute using the value expression returned by the given function.
|
<Y,V extends Y> |
set(SingularAttribute<? super X,Y> attribute,
V value)
Set the property described by the specified attribute to the specified value.
|
UpdateStream<X> |
skip(int num)
Return this stream with the specified number of initial elements skipped.
|
int |
update()
Build and execute a JPA query based on this instance.
|
UpdateStream<X> |
withFetchGraph(String name)
Configure a fetch graph for this query.
|
UpdateStream<X> |
withFlushMode(FlushModeType flushMode)
Set the
FlushModeType associated with this query. |
UpdateStream<X> |
withHint(String name,
Object value)
Associate a hint with this query.
|
UpdateStream<X> |
withHints(Map<String,Object> hints)
Associate hints with this query.
|
UpdateStream<X> |
withLoadGraph(String name)
Configure a load graph for this query.
|
UpdateStream<X> |
withLockMode(LockModeType lockMode)
Set the
LockModeType associated with this query. |
UpdateStream<X> |
withParam(Parameter<Calendar> parameter,
Calendar value,
TemporalType temporalType)
Bind the value of a query parameter of type
Calendar. |
UpdateStream<X> |
withParam(Parameter<Date> parameter,
Date value,
TemporalType temporalType)
Bind the value of a query parameter of type
Date. |
<T> UpdateStream<X> |
withParam(Parameter<T> parameter,
T value)
Bind the value of a query parameter.
|
UpdateStream<X> |
withParams(Iterable<? extends ParamBinding<?>> params)
Associate parameter bindings with this query.
|
getEntityManager, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParams, newBuilder, toCriteriaQuery, toQueryconfigureint update()
Ultimately delegates to Query.executeUpdate() and can throw any exception thrown by that method.
<Y> UpdateStream<X> set(Path<Y> path, Expression<? extends Y> value)
Path to the value described by the specified expression.Y - property typepath - the property to be setvalue - JPA expression for the value to setIllegalArgumentException - if path is nullIllegalArgumentException - if value is null<Y,V extends Y> UpdateStream<X> set(Path<Y> path, V value)
Path to the specified value.Y - property typeV - value typepath - the property to be setvalue - the value to setIllegalArgumentException - if path is null<Y> UpdateStream<X> set(SingularAttribute<? super X,Y> attribute, Expression<? extends Y> value)
Y - property typeattribute - entity attribute to be setvalue - JPA expression for the value to setIllegalArgumentException - if attribute is nullIllegalArgumentException - if value is null<Y,V extends Y> UpdateStream<X> set(SingularAttribute<? super X,Y> attribute, V value)
Y - property typeV - value typeattribute - entity attribute to be setvalue - the value to setIllegalArgumentException - if attribute is null<Y> UpdateStream<X> set(Path<Y> path, Function<? super Root<X>,? extends Expression<? extends Y>> expressionBuilder)
Path using the value expression returned by the given function.Y - property typepath - the property to be setexpressionBuilder - function returning a JPA expression for the value to setIllegalArgumentException - if path is nullIllegalArgumentException - if expressionBuilder is null<Y> UpdateStream<X> set(SingularAttribute<? super X,Y> attribute, Function<? super Root<X>,? extends Expression<? extends Y>> expressionBuilder)
Y - property typeattribute - entity attribute to be setexpressionBuilder - function returning a JPA expression for the value to setIllegalArgumentException - if attribute is nullIllegalArgumentException - if expressionBuilder is nullUpdateType<X> getQueryType()
QueryStreamQueryType of this instance.getQueryType in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>QueryTypeUpdateStream<X> bind(Ref<X,? super Root<X>> ref)
QueryStreambind in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>ref - unbound referenceref<X2,S2 extends Selection<X2>> UpdateStream<X> bind(Ref<X2,? super S2> ref, Function<? super Root<X>,? extends S2> refFunction)
QueryStreambind in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>X2 - type of the bound valueS2 - criteria type of the bound valueref - unbound referencerefFunction - function mapping this stream's Selection to the reference valuerefUpdateStream<X> peek(Consumer<? super Root<X>> peeker)
QueryStream
This is useful in cases where the selection can be modified, e.g., setting join ON conditions
using Join.on().
peek in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>peeker - peeker into streamUpdateStream<X> filter(SingularAttribute<? super X,Boolean> attribute)
QueryStreamAdds to any previously specified filters.
filter in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>attribute - boolean propertyUpdateStream<X> filter(Function<? super Root<X>,? extends Expression<Boolean>> predicateBuilder)
QueryStreamAdds to any previously specified filters.
filter in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>predicateBuilder - function mapping this stream's item to a boolean ExpressionUpdateStream<X> limit(int maxSize)
QueryStreamDue 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.).
limit in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>maxSize - maximum number of elements to returnUpdateStream<X> skip(int num)
QueryStreamDue 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.).
skip in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>num - number of elements to skipUpdateStream<X> withFlushMode(FlushModeType flushMode)
QueryStreamFlushModeType associated with this query.withFlushMode in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>flushMode - new flush modeQuery.setFlushMode(javax.persistence.FlushModeType)UpdateStream<X> withLockMode(LockModeType lockMode)
QueryStreamLockModeType associated with this query.withLockMode in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>lockMode - new lock modeQuery.setLockMode(javax.persistence.LockModeType)UpdateStream<X> withHint(String name, Object value)
QueryStreamwithHint in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>name - name of hintvalue - value of hintQuery.setHint(java.lang.String, java.lang.Object)UpdateStream<X> withHints(Map<String,Object> hints)
QueryStreamwithHints in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>hints - hints to addQuery.setHint(java.lang.String, java.lang.Object)<T> UpdateStream<X> withParam(Parameter<T> parameter, T value)
QueryStreamReplaces any previous binding of the same parameter.
withParam in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>T - parameter value typeparameter - the parameter to setvalue - parameter valueQuery.setParameter(javax.persistence.Parameter, Object)UpdateStream<X> withParam(Parameter<Date> parameter, Date value, TemporalType temporalType)
QueryStreamDate.
Replaces any previous binding of the same parameter.
withParam in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>parameter - the parameter to setvalue - parameter valuetemporalType - temporal type for valueQuery.setParameter(javax.persistence.Parameter, Date, TemporalType)UpdateStream<X> withParam(Parameter<Calendar> parameter, Calendar value, TemporalType temporalType)
QueryStreamCalendar.
Replaces any previous binding of the same parameter.
withParam in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>parameter - the parameter to setvalue - parameter valuetemporalType - temporal type for valueQuery.setParameter(javax.persistence.Parameter, Calendar, TemporalType)UpdateStream<X> withParams(Iterable<? extends ParamBinding<?>> params)
QueryStreamReplaces any previous bindings of the same parameters.
withParams in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>params - bindings to addQuery.setParameter(javax.persistence.Parameter, Object)UpdateStream<X> withLoadGraph(String name)
QueryStream
Equivalent to withHint("javax.persistence.loadgraph", name).
withLoadGraph in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>name - name of load graphUpdateStream<X> withFetchGraph(String name)
QueryStream
Equivalent to withHint("javax.persistence.fetchgraph", name).
withFetchGraph in interface QueryStream<X,Root<X>,CriteriaUpdate<X>,CriteriaUpdate<X>,Query>name - name of fetch graphCopyright © 2023. All rights reserved.