Package org.hibernate.loader.custom
Interface CustomQuery
- All Known Implementing Classes:
SQLCustomQuery
public interface CustomQuery
Extension point allowing any SQL query with named and positional parameters
to be executed by Hibernate, returning managed entities, collections and
simple scalar values.
-
Method Summary
Modifier and TypeMethodDescriptionA collection ofdescriptorsdescribing the JDBC result set to be expected and how to map this result set.A map representing positions within the suppliedqueryto which we need to bind named parameters.Any query spaces to apply to the query execution.getSQL()The SQL query string to be performed.
-
Method Details
-
getSQL
String getSQL()The SQL query string to be performed.- Returns:
- The SQL statement string.
-
getQuerySpaces
Set getQuerySpaces()Any query spaces to apply to the query execution. Query spaces are used in Hibernate's auto-flushing mechanism to determine which entities need to be checked for pending changes.- Returns:
- The query spaces
-
getNamedParameterBindPoints
Map getNamedParameterBindPoints()A map representing positions within the suppliedqueryto which we need to bind named parameters. Optional, may return null if no named parameters. The structure of the returned map (if one) as follows:- The keys into the map are the named parameter names
- The corresponding value is either an
Integerif the parameter occurs only once in the query; or a List of Integers if the parameter occurs more than once
-
getCustomQueryReturns
List getCustomQueryReturns()A collection ofdescriptorsdescribing the JDBC result set to be expected and how to map this result set.- Returns:
- List of return descriptors.
-