public class QueryHints extends Object
Consolidation of hints available to Hibernate JPA queries. Mainly used to define features available on Hibernate queries that have no corollary in JPA queries.
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_MODE
The cache mode to use.
|
static String |
CACHE_REGION
The cache region to use.
|
static String |
CACHEABLE
Are the query results cacheable?
|
static String |
CALLABLE
Is the query callable? Note: only valid for named native sql queries.
|
static String |
COMMENT
Defines a comment to be applied to the SQL sent to the database.
|
static String |
FETCH_SIZE
Defines the JDBC fetch size to use.
|
static String |
FETCHGRAPH
Hint providing a "fetchgraph" EntityGraph.
|
static String |
FLUSH_MODE
The flush mode to associate with the execution of the query.
|
static String |
FOLLOW_ON_LOCKING
Hint to enable/disable the follow-on-locking mechanism provided by
Dialect.useFollowOnLocking(QueryParameters) . |
static String |
LOADGRAPH
Hint providing a "loadgraph" EntityGraph.
|
static String |
NATIVE_LOCKMODE
Available to apply lock mode to a native SQL query since JPA requires that
Query.setLockMode(javax.persistence.LockModeType) throw an IllegalStateException if called for a native query. |
static String |
PASS_DISTINCT_THROUGH
Hint to enable/disable the pass-distinct-through mechanism.
|
static String |
READ_ONLY
Should entities returned from the query be set in read only mode?
|
static String |
TIMEOUT_HIBERNATE
Apply a Hibernate query timeout, which is defined in <b>seconds</b>.
|
static String |
TIMEOUT_JPA
Apply a JPA query timeout, which is defined in <b>milliseconds</b>.
|
public static final String CACHE_MODE
The cache mode to use.
public static final String CACHE_REGION
The cache region to use.
public static final String CACHEABLE
Are the query results cacheable?
public static final String CALLABLE
Is the query callable? Note: only valid for named native sql queries.
public static final String COMMENT
Defines a comment to be applied to the SQL sent to the database.
public static final String FETCH_SIZE
Defines the JDBC fetch size to use.
public static final String FLUSH_MODE
The flush mode to associate with the execution of the query.
public static final String READ_ONLY
Should entities returned from the query be set in read only mode?
public static final String TIMEOUT_HIBERNATE
Apply a Hibernate query timeout, which is defined in <b>seconds</b>.
public static final String TIMEOUT_JPA
Apply a JPA query timeout, which is defined in <b>milliseconds</b>.
public static final String NATIVE_LOCKMODE
Available to apply lock mode to a native SQL query since JPA requires that
Query.setLockMode(javax.persistence.LockModeType)
throw an IllegalStateException if called for a native query.
<p/>
Accepts a LockModeType
or a LockMode
public static final String FETCHGRAPH
Hint providing a "fetchgraph" EntityGraph. Attributes explicitly specified as AttributeNodes are treated as FetchType.EAGER (via join fetch or subsequent select).
Note: Currently, attributes that are not specified are treated as FetchType.LAZY or FetchType.EAGER depending on the attribute’s definition in metadata, rather than forcing FetchType.LAZY.
public static final String LOADGRAPH
Hint providing a "loadgraph" EntityGraph. Attributes explicitly specified as AttributeNodes are treated as FetchType.EAGER (via join fetch or subsequent select). Attributes that are not specified are treated as FetchType.LAZY or FetchType.EAGER depending on the attribute’s definition in metadata
public static final String FOLLOW_ON_LOCKING
Hint to enable/disable the follow-on-locking mechanism provided by Dialect.useFollowOnLocking(QueryParameters)
.
A value of true
enables follow-on-locking, whereas a value of false
disables it.
If the value is null
, the the Dialect
strategy is going to be used instead.
public static final String PASS_DISTINCT_THROUGH
Hint to enable/disable the pass-distinct-through mechanism.
A value of true
enables pass-distinct-through, whereas a value of false
disables it.
When the pass-distinct-through is disabled, the HQL and JPQL distinct clause is no longer passed to the SQL statement.
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.