Deprecated
(since 5.2) use CommonQueryContract instead.
| Modifier and Type | Method and Description |
|---|---|
| public CacheMode | |
| public String | Returns: The specified cache region name into which query results should be placed;null indicates
the default region.Obtain the name of the second level query cache region in which query results will be stored (if they are
cached, see the discussion on |
| public Integer | Returns: The timeout in secondsObtain the JDBC fetch size hint in effect for this query. |
| public FlushMode | |
| public Type[] | Returns: an array of types
Deprecated
(since 5.2) with no replacement; to be removed in 6.0
Return the Hibernate types of the query results.
|
| public Integer | |
| public boolean | Returns: true if the query results are eligible for caching, false otherwise.Are the results of this query eligible for second level query caching? |
| public boolean | Returns: true if the entities and proxies loaded by the query will be put
in read-only mode; false otherwise (they will be modifiable)Should entities and proxies loaded by this Query be put in read-only mode? |
| public T | Returns: this, for method chainingShould the query results be cacheable? cacheable)Enable/disable second level query (result) caching for this query. |
| public T | Returns: this, for method chainingThe new CacheMode to use. cacheMode)(Re)set the current CacheMode in effect for this query. |
| public T | Returns: this, for method chainingthe name of a query cache region, or cacheRegion)null to indicate that the default region
should be used.Set the name of the cache region where query results should be cached (if cached at all). |
| public T | Returns: this, for method chainingthe fetch size hint fetchSize)Sets a JDBC fetch size hint for the query. |
| public default BasicQueryContract | Returns: this, for method chainingThe new FlushMode to use. flushMode)
Deprecated
(since 5.2) use
(Re)set the current FlushMode in effect for this query.
setHibernateFlushMode instead
|
| public T | Returns: this, for method chainingThe new FlushMode to use. flushMode)(Re)set the current FlushMode in effect for this query. |
| public T | Returns: this, for method chainingtrue indicates that entities and proxies loaded by the query
are to be put in read-only mode; false indicates that entities and proxies
loaded by the query will be put in modifiable modeSet the read-only/modifiable mode for entities and proxies loaded by this Query. |
| public T | Returns: this, for method chainingthe timeout in seconds timeout)Set the query timeout in seconds. |
| getCacheMode | back to summary |
|---|---|
| public CacheMode getCacheMode() Obtain the CacheMode in effect for this query. By default, the query inherits the CacheMode of the Session from which is originates. Note The CacheMode here only effects reading/writing of the query cache, not the entity/collection caches.
| |
| getCacheRegion | back to summary |
|---|---|
| public String getCacheRegion() Obtain the name of the second level query cache region in which query results will be stored (if they are
cached, see the discussion on
| |
| getFetchSize | back to summary |
|---|---|
| public Integer getFetchSize() Obtain the JDBC fetch size hint in effect for this query. This value is eventually passed along to the JDBC
query via
| |
| getHibernateFlushMode | back to summary |
|---|---|
| public FlushMode getHibernateFlushMode() Obtain the FlushMode in effect for this query. By default, the query inherits the FlushMode of the Session from which it originates.
| |
| getReturnTypes | back to summary |
|---|---|
| public Type[] getReturnTypes()
Deprecated (since 5.2) with no replacement; to be removed in 6.0 Return the Hibernate types of the query results.
| |
| getTimeout | back to summary |
|---|---|
| public Integer getTimeout() Obtain the query timeout in seconds. This value is eventually passed along to the JDBC query via
| |
| isCacheable | back to summary |
|---|---|
| public boolean isCacheable() Are the results of this query eligible for second level query caching? This is different than second level caching of any returned entities and collections. Note the query being "eligible" for caching does not necessarily mean its results will be cached. Second level
query caching still has to be enabled on the
| |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly() Should entities and proxies loaded by this Query be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.
| |
| setCacheable | back to summary |
|---|---|
| public T setCacheable(boolean cacheable) Enable/disable second level query (result) caching for this query.
| |
| setCacheMode | back to summary |
|---|---|
| public T setCacheMode(CacheMode cacheMode) (Re)set the current CacheMode in effect for this query.
| |
| setCacheRegion | back to summary |
|---|---|
| public T setCacheRegion(String cacheRegion) Set the name of the cache region where query results should be cached (if cached at all).
| |
| setFetchSize | back to summary |
|---|---|
| public T setFetchSize(int fetchSize) Sets a JDBC fetch size hint for the query.
| |
| setFlushMode | back to summary |
|---|---|
| public default BasicQueryContract Deprecated (since 5.2) use (Re)set the current FlushMode in effect for this query.
| |
| setHibernateFlushMode | back to summary |
|---|---|
| public T setHibernateFlushMode(FlushMode flushMode) (Re)set the current FlushMode in effect for this query.
| |
| setTimeout | back to summary |
|---|---|
| public T setTimeout(int timeout) Set the query timeout in seconds. NOTE it is important to understand that any value set here is eventually passed directly through to the JDBC Statement which expressly disallows negative values. So negative values should be avoided as a general rule.
| |