KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: NamedQueryDefinition.java,v 1.8 2005/07/13 02:11:43 oneovthafew Exp $
2
package org.hibernate.engine;
3
4 import java.io.Serializable JavaDoc;
5 import java.util.Map JavaDoc;
6
7 import org.hibernate.FlushMode;
8
9
10 /**
11  * Definition of a named query, defined in the mapping metadata.
12  *
13  * @author Gavin King
14  */

15 public class NamedQueryDefinition implements Serializable JavaDoc {
16     private final String JavaDoc query;
17     private final boolean cacheable;
18     private final String JavaDoc cacheRegion;
19     private final Integer JavaDoc timeout;
20     private final Integer JavaDoc fetchSize;
21     private final FlushMode flushMode;
22     private final Map JavaDoc parameterTypes;
23
24     public NamedQueryDefinition(
25         String JavaDoc query,
26         boolean cacheable,
27         String JavaDoc cacheRegion,
28         Integer JavaDoc timeout,
29         Integer JavaDoc fetchSize,
30         FlushMode flushMode,
31         Map JavaDoc parameterTypes
32     ) {
33         this.query = query;
34         this.cacheable = cacheable;
35         this.cacheRegion = cacheRegion;
36         this.timeout = timeout;
37         this.fetchSize = fetchSize;
38         this.flushMode = flushMode;
39         this.parameterTypes = parameterTypes;
40     }
41
42     public String JavaDoc getQueryString() {
43         return query;
44     }
45
46     public boolean isCacheable() {
47         return cacheable;
48     }
49
50     public String JavaDoc getCacheRegion() {
51         return cacheRegion;
52     }
53
54     public Integer JavaDoc getFetchSize() {
55         return fetchSize;
56     }
57
58     public Integer JavaDoc getTimeout() {
59         return timeout;
60     }
61
62     public FlushMode getFlushMode() {
63         return flushMode;
64     }
65
66     public String JavaDoc toString() {
67         return getClass().getName() + '(' + query + ')';
68     }
69
70     public Map JavaDoc getParameterTypes() {
71         return parameterTypes;
72     }
73 }
74
Popular Tags