Top Description Interfaces Classes Enums
[default module]

Package org.hibernate.query


Everything related to HQL/JPQL, native SQL, and criteria queries.

The important interfaces org.hibernate.query.SelectionQuery, org.hibernate.query.MutationQuery, org.hibernate.query.Query, and org.hibernate.query.NativeQuery provide an API for executing queries. Instances of these interfaces may be obtained from a org.hibernate.query.QueryProducer, that is, from any org.hibernate.Session or org.hibernate.StatelessSession.

Hibernate's extensions to the JPA criteria query API are defined in the subpackage org.hibernate.query.criteria, with org.hibernate.query.criteria.HibernateCriteriaBuilder as the entry point.

Other subpackages contain SPIs and internal implementation details, including the HQL parser and translator.

Interface Summary

Modifier and TypeInterface and Description
public interface
BindableType<J>

Types that can be used to handle binding Query parameters

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.

public interface
JpaTuple

Hibernate extension to the Jakarta Persistence Tuple contract

public interface
MutationQuery

Within the context of an active session, an instance of this type represents an executable mutation query, that is, an insert, update, or delete.

public interface
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.

public interface
OutputableType<J>

Specialization of org.hibernate.metamodel.model.domain.DomainType for types that can be used as a parameter output for a org.hibernate.procedure.ProcedureCall.

public interface
ParameterMetadata

Access to known information about the parameters for a query.

public interface
Query<
The result type, for typed queries, or Object for untyped queries
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.
public interface
public interface
QueryParameter<T>

Represents a parameter defined in the source (HQL/JPQL or criteria) query.

public interface
QueryProducer

Contract for things that can produce instances of Query and NativeQuery.

public interface
ResultListTransformer<T>

Defines some processing performed on the overall result List of a Query before the result list is returned to the caller.

public interface
ReturnableType<T>

Specialization of DomainType for types that can be used as function returns

public interface
SelectionQuery<R>

Within the context of an active session, an instance of this type represents an executable selection query, that is, a select.

public interface
SynchronizeableQuery

Represents the abstract notion of a query whose results are affected by the data stored in a given set of named query spaces.

public interface
TupleTransformer<T>

Defines some transformation applied to each result of a Query before the results are packaged as a List and returned to the caller.

public interface
TypedTupleTransformer<T>

Extension to TupleTransformer exposing the transformation target type.

Class Summary

Modifier and TypeClass and Description
public class
public class
IllegalNamedQueryOptionsException

Indicates a named-query has specified options that are not legal

public class
IllegalQueryOperationException

Indicates an attempt to perform some operation on a Query that is illegal based on its state, e.g., attempt to call Query#executeUpdate on a SELECT query.

public class
IllegalSelectQueryException

Indicates an attempt to call QueryProducer#createSelectionQuery(String) with a non-selection query (generally a mutation query)

public class
NamedQueryValidationException

Indicates that validation and translation of one or more named queries failed at initialization time.

public class
NotIndexedCollectionException

Indicates an attempt to use a non-indexed collection as indexed.

public class
Order<
The result type of the query to be sorted
X
>

A rule for sorting a query result set.

public class
Page

Identifies a page of query results by page size and page number.

public class
ParameterLabelException

Indicates a problem with the labelling of query parameters.

public class
PathException

Indicates a problem with a path expression in HQL/JPQL.

public class
QueryArgumentException

An error that occurs binding an argument to a query parameter.

public class
QueryTypeMismatchException

Indicates a mismatch between the expected and actual result types of a query.

public class
SemanticException

Represents an error in the semantics (meaning) of a HQL/JPQL query.

public class
SyntaxException

Represents a syntax error in a HQL/JPQL query.

public class
TypedParameterValue<J>

Represents a typed argument to a query parameter.

public class
UnknownNamedQueryException

Occurs when a named query is requested, and there is no known HQL or native SQL query registered under the given name.

public class
UnknownParameterException

Indicates an attempt to find an unknown query parameter or an attempt to bind a value to an unknown query parameter

public class
UnknownSqlResultSetMappingException

Indicates a request for named ResultSet mapping which could not be found

Enum Summary

Modifier and TypeEnum and Description
public enum
ImmutableEntityUpdateQueryHandlingMode

This enum defines how org.hibernate.annotations.Immutable entities are handled when executing a bulk update statement.

public enum
NullPrecedence

Enumerates the possibilities for the precedence of null values within query result sets sorted by an ORDER BY clause.

public enum
SortDirection

Enumerates the directions in which query results may be sorted.