Package org.hibernate.query

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

@Incubatingpublic interfaceMutationQueryextendsCommonQueryContract
Within the context of an activesession, an instance of this type represents an executable mutation query, that is, aninsert,update, ordelete. It is a slimmed-down version ofQuery, providing only methods relevant to mutation queries.

AMutationQuery may be obtained from theSession by calling:

AMutationQuery 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();