org.hibernate.loader.custom.sql
Class SQLCustomQuery

java.lang.Object
  extended by org.hibernate.loader.custom.sql.SQLCustomQuery
All Implemented Interfaces:
CustomQuery

public class SQLCustomQuery
extends Object
implements CustomQuery

Implements Hibernate's built-in support for native SQL queries.

This support is built on top of the notion of "custom queries"...

Author:
Gavin King, Max Andersen, Steve Ebersole

Field Summary
static org.apache.commons.logging.Log log
           
 
Constructor Summary
SQLCustomQuery(String sqlQuery, NativeSQLQueryReturn[] queryReturns, Collection additionalQuerySpaces, SessionFactoryImplementor factory)
           
 
Method Summary
 List getCustomQueryReturns()
          A collection of descriptors describing the JDBC result set to be expected and how to map this result set.
 Map getNamedParameterBindPoints()
          A map representing positions within the supplied query to which we need to bind named parameters.
 Set getQuerySpaces()
          Any query spaces to apply to the query execution.
 String getSQL()
          The SQL query string to be performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.commons.logging.Log log
Constructor Detail

SQLCustomQuery

public SQLCustomQuery(String sqlQuery,
                      NativeSQLQueryReturn[] queryReturns,
                      Collection additionalQuerySpaces,
                      SessionFactoryImplementor factory)
               throws HibernateException
Throws:
HibernateException
Method Detail

getSQL

public String getSQL()
Description copied from interface: CustomQuery
The SQL query string to be performed.

Specified by:
getSQL in interface CustomQuery
Returns:
The SQL statement string.

getQuerySpaces

public Set getQuerySpaces()
Description copied from interface: CustomQuery
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.

Specified by:
getQuerySpaces in interface CustomQuery
Returns:
The query spaces

getNamedParameterBindPoints

public Map getNamedParameterBindPoints()
Description copied from interface: CustomQuery
A map representing positions within the supplied query to 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:

  1. The keys into the map are the named parameter names
  2. The corresponding value is either an Integer if the parameter occurs only once in the query; or a List of Integers if the parameter occurs more than once

Specified by:
getNamedParameterBindPoints in interface CustomQuery

getCustomQueryReturns

public List getCustomQueryReturns()
Description copied from interface: CustomQuery
A collection of descriptors describing the JDBC result set to be expected and how to map this result set.

Specified by:
getCustomQueryReturns in interface CustomQuery
Returns:
List of return descriptors.