Package org.hibernate.query
Everything related to HQL/JPQL, native SQL, and criteria queries.
The important interfaces SelectionQuery
,
MutationQuery
, Query
,
and NativeQuery
provide an API for executing
queries. Instances of these interfaces may be obtained from a
QueryProducer
, that is, from any
Session
or StatelessSession
.
Hibernate's extensions to the JPA criteria query API are defined in the
subpackage org.hibernate.query.criteria
, with
HibernateCriteriaBuilder
as the
entry point.
Other subpackages contain SPIs and internal implementation details, including the HQL parser and translator.
-
Interface Summary Interface Description BindableType<J> Types that can be used to handle bindingQuery
parametersCommonQueryContract 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.JpaTuple Hibernate extension to the Jakarta PersistenceTuple
contractMutationQuery Within the context of an active session, an instance of this type represents an executable mutation query, that is, aninsert
,update
, ordelete
.NativeQuery<T> Within the context of an active session, an instance of this type represents an executable query written in the native SQL dialect of the underlying database.NativeQuery.CollectionReturn Allows access to further control how collection returns are mapped back from result sets.NativeQuery.FetchReturn Allows access to further control how join fetch returns are mapped back from result sets.NativeQuery.InstantiationResultNode<J> NativeQuery.ResultNode Simple unification interface for all returns from the variousaddXYZ()
methods.NativeQuery.ReturnableResultNode ANativeQuery.ResultNode
which can be a query result.NativeQuery.ReturnProperty Allows access to further control how properties within a root or join fetch are mapped back from the result set.NativeQuery.RootReturn Allows access to further control how root returns are mapped back from result sets.OutputableType<J> Specialization of DomainType for types that can be used as a parameter output for aProcedureCall
ParameterMetadata Access to known information about the parameters for a query.Query<R> Within the context of an active session, an instance of this type represents an executable query, either: a query written in HQL, a named query written in HQL or native SQL, or a criteria query.QueryLogging QueryParameter<T> Represents a parameter defined in the source (HQL/JPQL or criteria) query.QueryProducer Contract for things that can produce instances ofQuery
andNativeQuery
.ResultListTransformer<T> ReturnableType<T> Specialization of DomainType for types that can be used as function returnsSelectionQuery<R> Within the context of an active session, an instance of this type represents an executable selection query, that is, aselect
.SynchronizeableQuery Represents the abstract notion of a query whose results are affected by the data stored in a given set of named query spaces.TupleTransformer<T> TypedTupleTransformer<T> Extension to TupleTransformer exposing the transformation target type. -
Class Summary Class Description TypedParameterValue<J> Can be used to bind query parameter values. -
Enum Summary Enum Description ImmutableEntityUpdateQueryHandlingMode This enum defines howImmutable
entities are handled when executing a bulk update statement. -
Exception Summary Exception Description IllegalMutationQueryException Indicates an attempt to callQueryProducer.createMutationQuery(String)
,QueryProducer.createNamedMutationQuery(String)
orQueryProducer.createNativeMutationQuery(String)
with a non-mutation query (generally a select query)IllegalNamedQueryOptionsException Indicates a named-query has specified options that are not legalIllegalQueryOperationException Indicates an attempt to perform some operation on a Query that is illegal based on its state, e.g., attempt to callQuery.executeUpdate()
on a SELECT query.IllegalSelectQueryException Indicates an attempt to callQueryProducer.createSelectionQuery(String)
with a non-selection query (generally a mutation query)NotIndexedCollectionException Indicates an attempt to use a non-indexed collection as indexed.PathException Indicates an attempt to use a path in an unsupported wayQueryTypeMismatchException Indicates a mismatch between a Query's expected and actual result typesSemanticException Represents an error in the semantics (meaning) of the passed query.UnknownNamedQueryException Indicates a request for a named-query when no query is registered under that nameUnknownParameterException Indicates an attempt to find an unknown query parameter or an attempt to bind a value to an unknown query parameterUnknownSqlResultSetMappingException Indicates a request for named ResultSet mapping which could not be found