~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/NamedQueryDefinition.java

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Hibernate, Relational Persistence for Idiomatic Java
3
 
 *
4
 
 * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
5
 
 * indicated by the @author tags or express copyright attribution
6
 
 * statements applied by the authors.  All third-party contributions are
7
 
 * distributed under license by Red Hat Middleware LLC.
8
 
 *
9
 
 * This copyrighted material is made available to anyone wishing to use, modify,
10
 
 * copy, or redistribute it subject to the terms and conditions of the GNU
11
 
 * Lesser General Public License, as published by the Free Software Foundation.
12
 
 *
13
 
 * This program is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
 
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
16
 
 * for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU Lesser General Public License
19
 
 * along with this distribution; if not, write to:
20
 
 * Free Software Foundation, Inc.
21
 
 * 51 Franklin Street, Fifth Floor
22
 
 * Boston, MA  02110-1301  USA
23
 
 *
24
 
 */
25
 
package org.hibernate.engine;
26
 
 
27
 
import java.io.Serializable;
28
 
import java.util.Map;
29
 
 
30
 
import org.hibernate.CacheMode;
31
 
import org.hibernate.FlushMode;
32
 
 
33
 
 
34
 
/**
35
 
 * Definition of a named query, defined in the mapping metadata.
36
 
 *
37
 
 * @author Gavin King
38
 
 */
39
 
public class NamedQueryDefinition implements Serializable {
40
 
        private final String query;
41
 
        private final boolean cacheable;
42
 
        private final String cacheRegion;
43
 
        private final Integer timeout;
44
 
        private final Integer fetchSize;
45
 
        private final FlushMode flushMode;
46
 
        private final Map parameterTypes;
47
 
        private CacheMode cacheMode;
48
 
        private boolean readOnly;
49
 
        private String comment;
50
 
 
51
 
        // kept for backward compatibility until after the 3.1beta5 release of HA
52
 
        public NamedQueryDefinition(
53
 
                        String query,
54
 
                        boolean cacheable,
55
 
                        String cacheRegion,
56
 
                        Integer timeout,
57
 
                        Integer fetchSize,
58
 
                        FlushMode flushMode,
59
 
                        Map parameterTypes
60
 
        ) {
61
 
                this(
62
 
                                query,
63
 
                                cacheable,
64
 
                                cacheRegion,
65
 
                                timeout,
66
 
                                fetchSize,
67
 
                                flushMode,
68
 
                                null,
69
 
                                false,
70
 
                                null,
71
 
                                parameterTypes
72
 
                );
73
 
        }
74
 
 
75
 
        public NamedQueryDefinition(
76
 
                        String query,
77
 
                        boolean cacheable,
78
 
                        String cacheRegion,
79
 
                        Integer timeout,
80
 
                        Integer fetchSize,
81
 
                        FlushMode flushMode,
82
 
                        CacheMode cacheMode,
83
 
                        boolean readOnly,
84
 
                        String comment,
85
 
                        Map parameterTypes
86
 
        ) {
87
 
                this.query = query;
88
 
                this.cacheable = cacheable;
89
 
                this.cacheRegion = cacheRegion;
90
 
                this.timeout = timeout;
91
 
                this.fetchSize = fetchSize;
92
 
                this.flushMode = flushMode;
93
 
                this.parameterTypes = parameterTypes;
94
 
                this.cacheMode = cacheMode;
95
 
                this.readOnly = readOnly;
96
 
                this.comment = comment;
97
 
        }
98
 
 
99
 
        public String getQueryString() {
100
 
                return query;
101
 
        }
102
 
 
103
 
        public boolean isCacheable() {
104
 
                return cacheable;
105
 
        }
106
 
 
107
 
        public String getCacheRegion() {
108
 
                return cacheRegion;
109
 
        }
110
 
 
111
 
        public Integer getFetchSize() {
112
 
                return fetchSize;
113
 
        }
114
 
 
115
 
        public Integer getTimeout() {
116
 
                return timeout;
117
 
        }
118
 
 
119
 
        public FlushMode getFlushMode() {
120
 
                return flushMode;
121
 
        }
122
 
 
123
 
        public String toString() {
124
 
                return getClass().getName() + '(' + query + ')';
125
 
        }
126
 
 
127
 
        public Map getParameterTypes() {
128
 
                return parameterTypes;
129
 
        }
130
 
 
131
 
        public String getQuery() {
132
 
                return query;
133
 
        }
134
 
 
135
 
        public CacheMode getCacheMode() {
136
 
                return cacheMode;
137
 
        }
138
 
 
139
 
        public boolean isReadOnly() {
140
 
                return readOnly;
141
 
        }
142
 
 
143
 
        public String getComment() {
144
 
                return comment;
145
 
        }
146
 
}