~ubuntu-branches/ubuntu/wily/libhibernate3-java/wily-proposed

« back to all changes in this revision

Viewing changes to src/org/hibernate/loader/custom/CustomQuery.java

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-10-14 14:43:34 UTC
  • Revision ID: james.westby@ubuntu.com-20071014144334-eamc8i0q10gs1aro
Tags: upstream-3.2.5
ImportĀ upstreamĀ versionĀ 3.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//$Id: CustomQuery.java 10018 2006-06-15 05:21:06Z steve.ebersole@jboss.com $
 
2
package org.hibernate.loader.custom;
 
3
 
 
4
import java.util.Map;
 
5
import java.util.Set;
 
6
import java.util.List;
 
7
 
 
8
/**
 
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.
 
12
 * 
 
13
 * @author Gavin King
 
14
 * @author Steve Ebersole
 
15
 */
 
16
public interface CustomQuery {
 
17
        /**
 
18
         * The SQL query string to be performed.
 
19
         *
 
20
         * @return The SQL statement string.
 
21
         */
 
22
        public String getSQL();
 
23
 
 
24
        /**
 
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.
 
28
         *
 
29
         * @return The query spaces
 
30
         */
 
31
        public Set getQuerySpaces();
 
32
 
 
33
        /**
 
34
         * A map representing positions within the supplied {@link #getSQL query} to
 
35
         * which we need to bind named parameters.
 
36
         * <p/>
 
37
         * Optional, may return null if no named parameters.
 
38
         * <p/>
 
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>
 
44
         * </ol>
 
45
         */
 
46
        public Map getNamedParameterBindPoints();
 
47
 
 
48
        /**
 
49
         * A collection of {@link Return descriptors} describing the
 
50
         * JDBC result set to be expected and how to map this result set.
 
51
         *
 
52
         * @return List of return descriptors.
 
53
         */
 
54
        public List getCustomQueryReturns();
 
55
}