Interface MutationQuery

All Superinterfaces:
CommonQueryContract
All Known Subinterfaces:
NativeQuery<T>, NativeQueryImplementor<R>, ProcedureCallImplementor<R>, Query<R>, QueryImplementor<R>, SqmQueryImplementor<R>
All Known Implementing Classes:
AbstractQuery, NativeQueryImpl, ProcedureCallImpl, QuerySqmImpl

@Incubating public interface MutationQuery extends CommonQueryContract
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 Session by calling:

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

 session.createMutationQuery("delete Draft where lastUpdated < local date - ?1 year")
         .setParameter(1, years)
         .executeUpdate();