1
//$Id: CustomQuery.java 10018 2006-06-15 05:21:06Z steve.ebersole@jboss.com $
2
package org.hibernate.loader.custom;
9
* Extension point allowing any SQL query with named and positional parameters
10
* to be executed by Hibernate, returning managed entities, collections and
11
* simple scalar values.
14
* @author Steve Ebersole
16
public interface CustomQuery {
18
* The SQL query string to be performed.
20
* @return The SQL statement string.
22
public String getSQL();
25
* Any query spaces to apply to the query execution. Query spaces are
26
* used in Hibernate's auto-flushing mechanism to determine which
27
* entities need to be checked for pending changes.
29
* @return The query spaces
31
public Set getQuerySpaces();
34
* A map representing positions within the supplied {@link #getSQL query} to
35
* which we need to bind named parameters.
37
* Optional, may return null if no named parameters.
39
* The structure of the returned map (if one) as follows:<ol>
40
* <li>The keys into the map are the named parameter names</li>
41
* <li>The corresponding value is either an {@link Integer} if the
42
* parameter occurs only once in the query; or a List of Integers if the
43
* parameter occurs more than once</li>
46
public Map getNamedParameterBindPoints();
49
* A collection of {@link Return descriptors} describing the
50
* JDBC result set to be expected and how to map this result set.
52
* @return List of return descriptors.
54
public List getCustomQueryReturns();