Interface CommonQueryContract

All Known Subinterfaces:
MutationQuery, NativeQuery<T>, NativeQueryImplementor<R>, ProcedureCall, ProcedureCallImplementor<R>, Query<R>, QueryImplementor<R>, SelectionQuery<R>, SqmQuery, SqmQueryImplementor<R>, SqmSelectionQuery<R>, SqmSelectionQueryImplementor<R>
All Known Implementing Classes:
AbstractCommonQueryContract, AbstractQuery, AbstractSelectionQuery, DelegatingSqmSelectionQueryImplementor, NativeQueryImpl, ProcedureCallImpl, QuerySqmImpl, SqmSelectionQueryImpl

public interface CommonQueryContract
Defines the aspects of query execution and parameter binding that apply to all forms of querying: HQL/JPQL queries, native SQL queries, criteria queries, and stored procedure calls.

Queries may have parameters, either ordinal or named, and the various setParameter() operations of this interface allow an argument to be bound to a parameter. It's not usually necessary to explicitly specify the type of an argument, but in rare cases where this is needed, TypedParameterValue may be used.

The operation setFlushMode(FlushModeType) allows a temporary flush mode to be specified, which is in effect only during the execution of this query. Setting the flush mode at the query level does not affect the flush mode of other operations performed via the parent session. This operation is usually used as follows:

query.setFlushMode(COMMIT).getResultList()

The call to setFlushMode(COMMIT) disables the usual automatic flush operation that occurs before query execution.

See Also: