KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > engine > NamedSQLQueryDefinition


1 //$Id: NamedSQLQueryDefinition.java,v 1.16 2005/07/13 02:11:43 oneovthafew Exp $
2
package org.hibernate.engine;
3
4 import java.util.List JavaDoc;
5 import java.util.Map JavaDoc;
6
7 import org.hibernate.FlushMode;
8 import org.hibernate.loader.custom.SQLQueryReturn;
9 import org.hibernate.loader.custom.SQLQueryScalarReturn;
10
11 /**
12  * Definition of a named native SQL query, defined
13  * in the mapping metadata.
14  *
15  * @author Max Andersen
16  */

17 public class NamedSQLQueryDefinition extends NamedQueryDefinition {
18
19     private SQLQueryReturn[] queryReturns;
20     private SQLQueryScalarReturn[] scalarReturns;
21     private final List JavaDoc querySpaces;
22     private final boolean callable;
23     private String JavaDoc resultSetRef;
24
25     public NamedSQLQueryDefinition(
26         String JavaDoc query,
27         SQLQueryReturn[] queryReturns,
28         SQLQueryScalarReturn[] scalarReturns,
29         List JavaDoc querySpaces,
30         boolean cacheable,
31         String JavaDoc cacheRegion,
32         Integer JavaDoc timeout,
33         Integer JavaDoc fetchSize,
34         FlushMode flushMode,
35         Map JavaDoc parameterTypes,
36         boolean callable
37     ) {
38         super(
39                 query.trim(), /* trim done to workaround stupid oracle bug that cant handle whitespaces before a { in a sp */
40                 cacheable,
41                 cacheRegion,
42                 timeout,
43                 fetchSize,
44                 flushMode,
45                 parameterTypes
46         );
47         this.queryReturns = queryReturns;
48         this.scalarReturns = scalarReturns;
49         this.querySpaces = querySpaces;
50         this.callable = callable;
51     }
52
53     public NamedSQLQueryDefinition(
54         String JavaDoc query,
55         String JavaDoc resultSetRef,
56         List JavaDoc querySpaces,
57         boolean cacheable,
58         String JavaDoc cacheRegion,
59         Integer JavaDoc timeout,
60         Integer JavaDoc fetchSize,
61         FlushMode flushMode,
62         Map JavaDoc parameterTypes,
63         boolean callable
64     ) {
65         super(
66                 query.trim(), /* trim done to workaround stupid oracle bug that cant handle whitespaces before a { in a sp */
67                 cacheable,
68                 cacheRegion,
69                 timeout,
70                 fetchSize,
71                 flushMode,
72                 parameterTypes
73         );
74         this.resultSetRef = resultSetRef;
75         this.querySpaces = querySpaces;
76         this.callable = callable;
77     }
78
79     public SQLQueryReturn[] getQueryReturns() {
80         return queryReturns;
81     }
82
83     public SQLQueryScalarReturn[] getScalarQueryReturns() {
84         return scalarReturns;
85     }
86
87     public List JavaDoc getQuerySpaces() {
88         return querySpaces;
89     }
90
91     public boolean isCallable() {
92         return callable;
93     }
94
95     public String JavaDoc getResultSetRef() {
96         return resultSetRef;
97     }
98 }
Popular Tags