insert, update, or delete. It is a slimmed-down
version of Query, providing only methods relevant to mutation queries.
A MutationQuery may be obtained from the org.
by calling:
QueryProducer#createMutationQuery(String), passing the HQL as a
string,
QueryProducer#createNativeMutationQuery(String), passing native
SQL as a string,
QueryProducer#createMutationQuery(jakarta.persistence.criteria.CriteriaUpdate) or
QueryProducer#createMutationQuery(jakarta.persistence.criteria.CriteriaDelete) ,
passing a criteria update or delete object, or
QueryProducer#createNamedMutationQuery(String), passing the
name of a query defined using jakarta.persistence.NamedQuery or
jakarta.persistence.NamedNativeQuery .
A MutationQuery controls how the mutation query is executed, and
allows arguments to be bound to its parameters.
executeUpdate().
setParameter(String, Object) and
setParameter(int, Object) allow arguments to be bound to named
and ordinal parameters defined by the query.
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the number of affected entity instances (may differ from the number of affected rows)Execute an insert, update, or delete statement, and return the number of affected entities. |
| public MutationQuery | setComment(String comment)
Redeclares org. |
| public MutationQuery | setFlushMode(FlushModeType flushMode)
Redeclares org. FlushMode in to use for this query.
|
| public MutationQuery | setHibernateFlushMode(FlushMode flushMode)
Redeclares org. FlushMode in effect for this query.
|
| public MutationQuery | setHint(String hintName, Object value)
Redeclares org. |
| public MutationQuery | setParameter(String name, Object value)
Redeclares org. |
| public <P> MutationQuery | setParameter(String name, P value, Class<P> type)
Redeclares org. Class reference to attempt to infer the BindableType.
|
| public <P> MutationQuery | setParameter(String name, P value, BindableType<P> type)
Redeclares org. BindableType.
|
| public MutationQuery | setParameter(String name, Instant value, TemporalType temporalType)
Redeclares org. Instant to the named query parameter using just the
portion indicated by the given TemporalType.
|
| public MutationQuery | setParameter(String name, Calendar value, TemporalType temporalType)
Redeclares org. |
| public MutationQuery | setParameter(String name, Date value, TemporalType temporalType)
Redeclares org. |
| public MutationQuery | setParameter(int position, Object value)
Redeclares org. |
| public <P> MutationQuery | setParameter(int position, P value, Class<P> type)
Redeclares org. Class reference to attempt to infer the BindableType.
|
| public <P> MutationQuery | setParameter(int position, P value, BindableType<P> type)
Redeclares org. BindableType.
|
| public MutationQuery | setParameter(int position, Instant value, TemporalType temporalType)
Redeclares org. Instant to an ordinal query parameter using just the
portion indicated by the given TemporalType.
|
| public MutationQuery | setParameter(int position, Date value, TemporalType temporalType)
Redeclares org. |
| public MutationQuery | setParameter(int position, Calendar value, TemporalType temporalType)
Redeclares org. |
| public <T> MutationQuery | setParameter(QueryParameter<T>
the query parameter memento parameter, T the argument, which might be null value)Redeclares org. QueryParameter.
|
| public <P> MutationQuery | setParameter(QueryParameter<P>
the query parameter memento parameter, P the argument, which might be null value, Class<P> a type)BindableType representing the type of the parameterRedeclares org. QueryParameter, using the given Class reference to attempt
to infer the BindableType to use.
|
| public <P> MutationQuery | setParameter(QueryParameter<P>
the query parameter memento parameter, P the argument, which might be null val, BindableType<P> a type)BindableType representing the type of the parameterRedeclares org. QueryParameter, using the given BindableType.
|
| public <T> MutationQuery | setParameter(Parameter<T> param, T value)
Redeclares org. |
| public MutationQuery | setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
Redeclares org. |
| public MutationQuery | setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
Redeclares org. |
| public MutationQuery | setParameterList(String name, Collection<E> values)
Redeclares org. |
| public <P> MutationQuery | setParameterList(String name, Collection<? extends P> values, Class<P> javaType)
Redeclares org. Class reference to attempt to infer the BindableType
If unable to infer an appropriate BindableType, fall back to
setParameterList(String, Collection).
|
| public <P> MutationQuery | setParameterList(String name, Collection<? extends P> values, BindableType<P> type)
Redeclares org. BindableType.
|
| public MutationQuery | setParameterList(String name, Object[] values)
Redeclares org. |
| public <P> MutationQuery | setParameterList(String name, P[] values, Class<P> javaType)
Redeclares org. BindableType
to use.
|
| public <P> MutationQuery | setParameterList(String name, P[] values, BindableType<P> type)
Redeclares org. BindableType.
|
| public MutationQuery | setParameterList(int position, Collection<E> values)
Redeclares org. |
| public <P> MutationQuery | setParameterList(int position, Collection<? extends P> values, Class<P> javaType)
Redeclares org. Class reference to attempt to infer the BindableType.
|
| public <P> MutationQuery | setParameterList(int position, Collection<? extends P> values, BindableType<P> type)
Redeclares org. BindableType.
|
| public MutationQuery | setParameterList(int position, Object[] values)
Redeclares org. |
| public <P> MutationQuery | setParameterList(int position, P[] values, Class<P> javaType)
Redeclares org. Class reference to attempt to infer the BindableType.
|
| public <P> MutationQuery | setParameterList(int position, P[] values, BindableType<P> type)
Redeclares org. BindableType.
|
| public <P> MutationQuery | setParameterList(QueryParameter<P>
the parameter memento parameter, Collection<? extends P> a collection of arguments values)Redeclares org. QueryParameter.
|
| public <P> MutationQuery | setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType)
Redeclares org. QueryParameter using the given Class reference
to attempt to infer the BindableType to use.
|
| public <P> MutationQuery | setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type)
Redeclares org. QueryParameter, using the given BindableType.
|
| public <P> MutationQuery | setParameterList(QueryParameter<P>
the parameter memento parameter, P[] a collection of arguments values)Redeclares org. QueryParameter.
|
| public <P> MutationQuery | setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType)
Redeclares org. QueryParameter using the given Class reference
to attempt to infer the BindableType to use.
|
| public <P> MutationQuery | setParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)
Redeclares org. QueryParameter, using the given the BindableType.
|
| public MutationQuery | setProperties(Object
any JavaBean or POJO bean)Redeclares org. |
| public MutationQuery | setProperties(Map<K, V>
a bean)Map of names to argumentsRedeclares org. Map to named parameters of the
query, matching key names with parameter names and mapping value types
to Hibernate types using heuristics.
|
| public MutationQuery | setTimeout(int
the timeout in seconds timeout)Redeclares org. |