2
* Hibernate, Relational Persistence for Idiomatic Java
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.
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.
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
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
25
package org.hibernate.engine;
27
import java.io.Serializable;
30
import org.hibernate.CacheMode;
31
import org.hibernate.FlushMode;
35
* Definition of a named query, defined in the mapping metadata.
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;
51
// kept for backward compatibility until after the 3.1beta5 release of HA
52
public NamedQueryDefinition(
75
public NamedQueryDefinition(
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;
99
public String getQueryString() {
103
public boolean isCacheable() {
107
public String getCacheRegion() {
111
public Integer getFetchSize() {
115
public Integer getTimeout() {
119
public FlushMode getFlushMode() {
123
public String toString() {
124
return getClass().getName() + '(' + query + ')';
127
public Map getParameterTypes() {
128
return parameterTypes;
131
public String getQuery() {
135
public CacheMode getCacheMode() {
139
public boolean isReadOnly() {
143
public String getComment() {