Top Description Methods
org.hibernate.query

public Interface MutationQuery

extends CommonQueryContract
Known Direct Subinterfaces
org.hibernate.query.Query
Annotations
@Incubating
Imports
java.time.Instant, java.util.Calendar, .Collection, .Date, .Map, org.hibernate.FlushMode, .Incubating, .Session, jakarta.persistence.FlushModeType, .Parameter, .TemporalType

Within the context of an active session, an instance of this type represents an executable mutation query, that is, an 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.hibernate.Session by calling:

A MutationQuery controls how the mutation query is executed, and allows arguments to be bound to its parameters.

Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of affected entity instances (may differ from the number of affected rows)
executeUpdate
()

Execute an insert, update, or delete statement, and return the number of affected entities.

public MutationQuery
setComment(String comment)

Redeclares org.hibernate.query.CommonQueryContract.setComment.

Set a comment for this query.
public MutationQuery
setFlushMode(FlushModeType flushMode)

Redeclares org.hibernate.query.CommonQueryContract.setFlushMode.

Set the FlushMode in to use for this query.
public MutationQuery
setHibernateFlushMode(FlushMode flushMode)

Redeclares org.hibernate.query.CommonQueryContract.setHibernateFlushMode.

Set the current FlushMode in effect for this query.
public MutationQuery
setHint(String hintName, Object value)

Redeclares org.hibernate.query.CommonQueryContract.setHint.

Set a hint.
public MutationQuery
setParameter(String name, Object value)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind the given argument to a named query parameter.
public <P> MutationQuery
setParameter(String name, P value, Class<P> type)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind the given argument to a named query parameter using the given Class reference to attempt to infer the BindableType.
public <P> MutationQuery
setParameter(String name, P value, BindableType<P> type)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind the given argument to a named query parameter using the given BindableType.
public MutationQuery
setParameter(String name, Instant value, TemporalType temporalType)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind an Instant to the named query parameter using just the portion indicated by the given TemporalType.
public MutationQuery
public MutationQuery
public MutationQuery
setParameter(int position, Object value)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind the given argument to an ordinal query parameter.
public <P> MutationQuery
setParameter(int position, P value, Class<P> type)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind the given argument to an ordinal query parameter using the given Class reference to attempt to infer the BindableType.
public <P> MutationQuery
setParameter(int position, P value, BindableType<P> type)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind the given argument to an ordinal query parameter using the given BindableType.
public MutationQuery
setParameter(int position, Instant value, TemporalType temporalType)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind an Instant to an ordinal query parameter using just the portion indicated by the given TemporalType.
public MutationQuery
public MutationQuery
public <T> MutationQuery
setParameter(QueryParameter<T>
the query parameter memento
parameter
,
T
the argument, which might be null
value
)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind an argument to the query parameter represented by the given QueryParameter.
public <P> MutationQuery
setParameter(QueryParameter<P>
the query parameter memento
parameter
,
P
the argument, which might be null
value
,
Class<P>
a BindableType representing the type of the parameter
type
)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind an argument to the query parameter represented by the given 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 BindableType representing the type of the parameter
type
)

Redeclares org.hibernate.query.CommonQueryContract.setParameter.

Bind an argument to the query parameter represented by the given QueryParameter, using the given BindableType.
public <T> MutationQuery
public MutationQuery
public MutationQuery
public MutationQuery
setParameterList(String name, Collection<E> values)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to a named query parameter.
public <P> MutationQuery
setParameterList(String name, Collection<? extends P> values, Class<P> javaType)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to a named query parameter using the given 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.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to a named query parameter using the given BindableType.
public MutationQuery
setParameterList(String name, Object[] values)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to a named query parameter.
public <P> MutationQuery
setParameterList(String name, P[] values, Class<P> javaType)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> MutationQuery
setParameterList(String name, P[] values, BindableType<P> type)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to a named query parameter using the given BindableType.
public MutationQuery
setParameterList(int position, Collection<E> values)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to an ordinal query parameter.
public <P> MutationQuery
setParameterList(int position, Collection<? extends P> values, Class<P> javaType)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given Class reference to attempt to infer the BindableType.
public <P> MutationQuery
setParameterList(int position, Collection<? extends P> values, BindableType<P> type)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given BindableType.
public MutationQuery
setParameterList(int position, Object[] values)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to an ordinal query parameter.
public <P> MutationQuery
setParameterList(int position, P[] values, Class<P> javaType)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given Class reference to attempt to infer the BindableType.
public <P> MutationQuery
setParameterList(int position, P[] values, BindableType<P> type)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given BindableType.
public <P> MutationQuery
setParameterList(QueryParameter<P>
the parameter memento
parameter
,
Collection<? extends P>
a collection of arguments
values
)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter.
public <P> MutationQuery
setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to the query parameter represented by the given 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.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter, using the given BindableType.
public <P> MutationQuery
setParameterList(QueryParameter<P>
the parameter memento
parameter
,
P[]
a collection of arguments
values
)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter.
public <P> MutationQuery
setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType)

Redeclares org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to the query parameter represented by the given 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.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter, using the given the BindableType.
public MutationQuery
setProperties(Object
any JavaBean or POJO
bean
)

Redeclares org.hibernate.query.CommonQueryContract.setProperties.

Bind the property values of the given bean to named parameters of the query, matching property names with parameter names and mapping property types to Hibernate types using heuristics.
public MutationQuery
setProperties(Map<K, V>
a Map of names to arguments
bean
)

Redeclares org.hibernate.query.CommonQueryContract.setProperties.

Bind the values of the given 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.hibernate.query.CommonQueryContract.setTimeout.

Set the query timeout in seconds.
Inherited from org.hibernate.query.CommonQueryContract:
getCommentgetFlushModegetHibernateFlushModegetTimeout