Top Description Fields Constructors Methods
org.hibernate.engine.spi

public Class NamedQueryDefinition

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
org.hibernate.engine.spi.NamedSQLQueryDefinition
Imports
java.io.Serializable, java.util.Map, org.hibernate.CacheMode, .FlushMode, .LockOptions

Definition of a named query, defined in the mapping metadata. Additionally, as of JPA 2.1, named query definition can also come from a compiled query.
Authors
Gavin King, Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final boolean
private final CacheMode
private final String
private final String
private final Integer
private final Integer
private final FlushMode
private final LockOptions
private final Integer
private final String
private final Map<K, V>
private final Boolean
private final String
private final boolean
private final Integer

Constructor Summary

AccessConstructor and Description
public
NamedQueryDefinition(String
The name under which to key/register the query
name
,
String
The query string.
query
,
boolean
Is the query cacheable?
cacheable
,
String
If cacheable, was there a specific region named?
cacheRegion
,
Integer
Query timeout, null indicates no timeout
timeout
,
Integer
Fetch size associated with the query, null indicates no limit
fetchSize
,
FlushMode
Flush mode associated with query
flushMode
,
CacheMode
Cache mode associated with query
cacheMode
,
boolean
Should entities returned from this query (those not already associated with the Session anyway) be loaded as read-only?
readOnly
,
String
SQL comment to be used in the generated SQL, null indicates none
comment
,
Map<K, V>
(no idea, afaict this is always passed as null)
parameterTypes
)

Deprecated Use NamedQueryDefinitionBuilder instead.
This form is used to bind named queries from Hibernate metadata, both hbm.xml files and org.hibernate.annotations.NamedQuery annotation.
public
NamedQueryDefinition(String
The name under which to key/register the query
name
,
String
The query string.
query
,
boolean
Is the query cacheable?
cacheable
,
String
If cacheable, was there a specific region named?
cacheRegion
,
Integer
Query timeout, null indicates no timeout
timeout
,
Integer
Specifies the lock timeout for queries that apply lock modes.
lockTimeout
,
Integer
Fetch size associated with the query, null indicates no limit
fetchSize
,
FlushMode
Flush mode associated with query
flushMode
,
CacheMode
Cache mode associated with query
cacheMode
,
boolean
Should entities returned from this query (those not already associated with the Session anyway) be loaded as read-only?
readOnly
,
String
SQL comment to be used in the generated SQL, null indicates none
comment
,
Map<K, V>
(no idea, afaict this is always passed as null)
parameterTypes
)

Deprecated Use NamedQueryDefinitionBuilder instead.
This version is used to bind named queries defined via javax.persistence.NamedQuery.
pack-priv
NamedQueryDefinition(String name, String query, boolean cacheable, String cacheRegion, Integer timeout, LockOptions lockOptions, Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, String comment, Map<K, V> parameterTypes, Integer firstResult, Integer maxResults, Boolean passDistinctThrough)

Method Summary

Modifier and TypeMethod and Description
public CacheMode
public String
public String
public Integer
public Integer
public FlushMode
public LockOptions
public Integer
public String
public Map<K, V>
public Boolean
public String
public String
public Integer
public boolean
public boolean
public NamedQueryDefinition
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

cacheableback to summary
private final boolean cacheable
cacheModeback to summary
private final CacheMode cacheMode
cacheRegionback to summary
private final String cacheRegion
commentback to summary
private final String comment
fetchSizeback to summary
private final Integer fetchSize
firstResultback to summary
private final Integer firstResult
flushModeback to summary
private final FlushMode flushMode
lockOptionsback to summary
private final LockOptions lockOptions
maxResultsback to summary
private final Integer maxResults
nameback to summary
private final String name
parameterTypesback to summary
private final Map<K, V> parameterTypes
passDistinctThroughback to summary
private final Boolean passDistinctThrough
queryback to summary
private final String query
readOnlyback to summary
private final boolean readOnly
timeoutback to summary
private final Integer timeout

Constructor Detail

NamedQueryDefinitionback to summary
public NamedQueryDefinition(String name, String query, boolean cacheable, String cacheRegion, Integer timeout, Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, String comment, Map<K, V> parameterTypes)

Deprecated

Use NamedQueryDefinitionBuilder instead.

This form is used to bind named queries from Hibernate metadata, both hbm.xml files and org.hibernate.annotations.NamedQuery annotation.

Parameters
name:String

The name under which to key/register the query

query:String

The query string.

cacheable:boolean

Is the query cacheable?

cacheRegion:String

If cacheable, was there a specific region named?

timeout:Integer

Query timeout, null indicates no timeout

fetchSize:Integer

Fetch size associated with the query, null indicates no limit

flushMode:FlushMode

Flush mode associated with query

cacheMode:CacheMode

Cache mode associated with query

readOnly:boolean

Should entities returned from this query (those not already associated with the Session anyway) be loaded as read-only?

comment:String

SQL comment to be used in the generated SQL, null indicates none

parameterTypes:Map<K, V>

(no idea, afaict this is always passed as null)

Annotations
@Deprecated
NamedQueryDefinitionback to summary
public NamedQueryDefinition(String name, String query, boolean cacheable, String cacheRegion, Integer timeout, Integer lockTimeout, Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, String comment, Map<K, V> parameterTypes)

Deprecated

Use NamedQueryDefinitionBuilder instead.

This version is used to bind named queries defined via javax.persistence.NamedQuery.

Parameters
name:String

The name under which to key/register the query

query:String

The query string.

cacheable:boolean

Is the query cacheable?

cacheRegion:String

If cacheable, was there a specific region named?

timeout:Integer

Query timeout, null indicates no timeout

lockTimeout:Integer

Specifies the lock timeout for queries that apply lock modes.

fetchSize:Integer

Fetch size associated with the query, null indicates no limit

flushMode:FlushMode

Flush mode associated with query

cacheMode:CacheMode

Cache mode associated with query

readOnly:boolean

Should entities returned from this query (those not already associated with the Session anyway) be loaded as read-only?

comment:String

SQL comment to be used in the generated SQL, null indicates none

parameterTypes:Map<K, V>

(no idea, afaict this is always passed as null)

Annotations
@Deprecated
NamedQueryDefinitionback to summary
pack-priv NamedQueryDefinition(String name, String query, boolean cacheable, String cacheRegion, Integer timeout, LockOptions lockOptions, Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, String comment, Map<K, V> parameterTypes, Integer firstResult, Integer maxResults, Boolean passDistinctThrough)

Method Detail

getCacheModeback to summary
public CacheMode getCacheMode()
getCacheRegionback to summary
public String getCacheRegion()
getCommentback to summary
public String getComment()
getFetchSizeback to summary
public Integer getFetchSize()
getFirstResultback to summary
public Integer getFirstResult()
getFlushModeback to summary
public FlushMode getFlushMode()
getLockOptionsback to summary
public LockOptions getLockOptions()
getMaxResultsback to summary
public Integer getMaxResults()
getNameback to summary
public String getName()
getParameterTypesback to summary
public Map<K, V> getParameterTypes()
getPassDistinctThroughback to summary
public Boolean getPassDistinctThrough()
getQueryback to summary
public String getQuery()
getQueryStringback to summary
public String getQueryString()
getTimeoutback to summary
public Integer getTimeout()
isCacheableback to summary
public boolean isCacheable()
isReadOnlyback to summary
public boolean isReadOnly()
makeCopyback to summary
public NamedQueryDefinition makeCopy(String name)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override