/
NamedQueryMemento.java
63 lines (47 loc) · 1.61 KB
/
NamedQueryMemento.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.query.named;
import java.util.Map;
import org.hibernate.CacheMode;
import org.hibernate.FlushMode;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.query.spi.QueryEngine;
import org.hibernate.query.spi.QueryImplementor;
import org.hibernate.query.spi.QueryParameterImplementor;
/**
* The runtime representation of named queries. They are stored in and
* available through the QueryEngine's {@link NamedObjectRepository}.
*
* This is the base contract for all specific types of named query mementos
*
* @author Steve Ebersole
*/
public interface NamedQueryMemento {
/**
* The name under which the query is registered
*/
String getRegistrationName();
Boolean getCacheable();
String getCacheRegion();
CacheMode getCacheMode();
FlushMode getFlushMode();
Boolean getReadOnly();
Integer getTimeout();
Integer getFetchSize();
String getComment();
Map<String, Object> getHints();
void validate(QueryEngine queryEngine);
/**
* Makes a copy of the memento using the specified registration name
*/
NamedQueryMemento makeCopy(String name);
QueryImplementor<?> toQuery(SharedSessionContractImplementor session);
<T> QueryImplementor<T> toQuery(SharedSessionContractImplementor session, Class<T> javaType);
interface ParameterMemento {
QueryParameterImplementor resolve(SharedSessionContractImplementor session);
}
}