Package org.hibernate.engine.spi
Class NamedQueryDefinition
- java.lang.Object
-
- org.hibernate.engine.spi.NamedQueryDefinition
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
NamedSQLQueryDefinition
public class NamedQueryDefinition extends java.lang.Object implements java.io.Serializable
Definition of a named query, defined in the mapping metadata. Additional, as of JPA 2.1, named query definition can also come from a compiled query.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NamedQueryDefinition(java.lang.String name, java.lang.String query, boolean cacheable, java.lang.String cacheRegion, java.lang.Integer timeout, java.lang.Integer lockTimeout, java.lang.Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, java.lang.String comment, java.util.Map parameterTypes)
Deprecated.UseNamedQueryDefinitionBuilder
instead.NamedQueryDefinition(java.lang.String name, java.lang.String query, boolean cacheable, java.lang.String cacheRegion, java.lang.Integer timeout, java.lang.Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, java.lang.String comment, java.util.Map parameterTypes)
Deprecated.UseNamedQueryDefinitionBuilder
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheMode
getCacheMode()
java.lang.String
getCacheRegion()
java.lang.String
getComment()
java.lang.Integer
getFetchSize()
java.lang.Integer
getFirstResult()
FlushMode
getFlushMode()
LockOptions
getLockOptions()
java.lang.Integer
getMaxResults()
java.lang.String
getName()
java.util.Map
getParameterTypes()
java.lang.String
getQuery()
java.lang.String
getQueryString()
java.lang.Integer
getTimeout()
boolean
isCacheable()
boolean
isReadOnly()
NamedQueryDefinition
makeCopy(java.lang.String name)
java.lang.String
toString()
-
-
-
Constructor Detail
-
NamedQueryDefinition
@Deprecated public NamedQueryDefinition(java.lang.String name, java.lang.String query, boolean cacheable, java.lang.String cacheRegion, java.lang.Integer timeout, java.lang.Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, java.lang.String comment, java.util.Map parameterTypes)
Deprecated.UseNamedQueryDefinitionBuilder
instead.This form is used to bind named queries from Hibernate metadata, bothhbm.xml
files andNamedQuery
annotation.- Parameters:
name
- The name under which to key/register the queryquery
- The query string.cacheable
- Is the query cacheable?cacheRegion
- If cacheable, was there a specific region named?timeout
- Query timeout,null
indicates no timeoutfetchSize
- Fetch size associated with the query,null
indicates no limitflushMode
- Flush mode associated with querycacheMode
- Cache mode associated with queryreadOnly
- Should entities returned from this query (those not already associated with the Session anyway) be loaded as read-only?comment
- SQL comment to be used in the generated SQL,null
indicates noneparameterTypes
- (no idea, afaict this is always passed as null)
-
NamedQueryDefinition
@Deprecated public NamedQueryDefinition(java.lang.String name, java.lang.String query, boolean cacheable, java.lang.String cacheRegion, java.lang.Integer timeout, java.lang.Integer lockTimeout, java.lang.Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, java.lang.String comment, java.util.Map parameterTypes)
Deprecated.UseNamedQueryDefinitionBuilder
instead.This version is used to bind named queries defined viaNamedQuery
.- Parameters:
name
- The name under which to key/register the queryquery
- The query string.cacheable
- Is the query cacheable?cacheRegion
- If cacheable, was there a specific region named?timeout
- Query timeout,null
indicates no timeoutlockTimeout
- Specifies the lock timeout for queries that apply lock modes.fetchSize
- Fetch size associated with the query,null
indicates no limitflushMode
- Flush mode associated with querycacheMode
- Cache mode associated with queryreadOnly
- Should entities returned from this query (those not already associated with the Session anyway) be loaded as read-only?comment
- SQL comment to be used in the generated SQL,null
indicates noneparameterTypes
- (no idea, afaict this is always passed as null)
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getQueryString
public java.lang.String getQueryString()
-
isCacheable
public boolean isCacheable()
-
getCacheRegion
public java.lang.String getCacheRegion()
-
getFetchSize
public java.lang.Integer getFetchSize()
-
getTimeout
public java.lang.Integer getTimeout()
-
getFlushMode
public FlushMode getFlushMode()
-
getParameterTypes
public java.util.Map getParameterTypes()
-
getQuery
public java.lang.String getQuery()
-
getCacheMode
public CacheMode getCacheMode()
-
isReadOnly
public boolean isReadOnly()
-
getComment
public java.lang.String getComment()
-
getLockOptions
public LockOptions getLockOptions()
-
getFirstResult
public java.lang.Integer getFirstResult()
-
getMaxResults
public java.lang.Integer getMaxResults()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
makeCopy
public NamedQueryDefinition makeCopy(java.lang.String name)
-
-