类 QueryHints
- java.lang.Object
-
- org.hibernate.annotations.QueryHints
-
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.
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringCACHE_MODEThe cache mode to use.static StringCACHE_REGIONThe cache region to use.static StringCACHEABLEAre the query results cacheable?static StringCALLABLEIs the query callable?static StringCOMMENTDefines a comment to be applied to the SQL sent to the database.static StringFETCH_SIZEDefines the JDBC fetch size to use.static StringFETCHGRAPH已过时。(since 5.4) UseGraphSemantic.FETCH'sGraphSemantic.getJpaHintName()insteadstatic StringFLUSH_MODEThe flush mode to associate with the execution of the query.static StringFOLLOW_ON_LOCKINGHint to enable/disable the follow-on-locking mechanism provided byDialect.useFollowOnLocking(QueryParameters).static StringLOADGRAPH已过时。(since 5.4) UseGraphSemantic.LOAD'sGraphSemantic.getJpaHintName()insteadstatic StringNATIVE_LOCKMODEAvailable to apply lock mode to a native SQL query since JPA requires thatQuery.setLockMode(javax.persistence.LockModeType)throw an IllegalStateException if called for a native query.static StringPASS_DISTINCT_THROUGHHint to enable/disable the pass-distinct-through mechanism.static StringREAD_ONLYShould entities returned from the query be set in read only mode?static StringTIMEOUT_HIBERNATEApply a Hibernate query timeout, which is defined in seconds.static StringTIMEOUT_JPAApply a JPA query timeout, which is defined in milliseconds.
-
-
-
字段详细资料
-
CACHE_MODE
public static final String CACHE_MODE
The cache mode to use.
-
CACHE_REGION
public static final String CACHE_REGION
The cache region to use.
-
CACHEABLE
public static final String CACHEABLE
Are the query results cacheable?
-
CALLABLE
public static final String CALLABLE
Is the query callable? Note: only valid for named native sql queries.- 另请参阅:
- 常量字段值
-
COMMENT
public static final String COMMENT
Defines a comment to be applied to the SQL sent to the database.
-
FETCH_SIZE
public static final String FETCH_SIZE
Defines the JDBC fetch size to use.
-
FLUSH_MODE
public static final String FLUSH_MODE
The flush mode to associate with the execution of the query.
-
READ_ONLY
public static final String READ_ONLY
Should entities returned from the query be set in read only mode?
-
TIMEOUT_HIBERNATE
public static final String TIMEOUT_HIBERNATE
Apply a Hibernate query timeout, which is defined in seconds.
-
TIMEOUT_JPA
public static final String TIMEOUT_JPA
Apply a JPA query timeout, which is defined in milliseconds.- 另请参阅:
- 常量字段值
-
NATIVE_LOCKMODE
public static final String NATIVE_LOCKMODE
Available to apply lock mode to a native SQL query since JPA requires thatQuery.setLockMode(javax.persistence.LockModeType)throw an IllegalStateException if called for a native query. Accepts aLockModeTypeor aLockMode- 另请参阅:
- 常量字段值
-
FETCHGRAPH
@Deprecated public static final String FETCHGRAPH
已过时。(since 5.4) UseGraphSemantic.FETCH'sGraphSemantic.getJpaHintName()insteadHint 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.
-
LOADGRAPH
@Deprecated public static final String LOADGRAPH
已过时。(since 5.4) UseGraphSemantic.LOAD'sGraphSemantic.getJpaHintName()insteadHint 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
-
FOLLOW_ON_LOCKING
public static final String FOLLOW_ON_LOCKING
Hint to enable/disable the follow-on-locking mechanism provided byDialect.useFollowOnLocking(QueryParameters). A value oftrueenables follow-on-locking, whereas a value offalsedisables it. If the value isnull, theDialectstrategy is going to be used instead.- 从以下版本开始:
- 5.2
- 另请参阅:
- 常量字段值
-
PASS_DISTINCT_THROUGH
public static final String PASS_DISTINCT_THROUGH
Hint to enable/disable the pass-distinct-through mechanism. A value oftrueenables pass-distinct-through, whereas a value offalsedisables it. When the pass-distinct-through is disabled, the HQL and JPQL distinct clause is no longer passed to the SQL statement.- 从以下版本开始:
- 5.2
- 另请参阅:
- 常量字段值
-
-