Package org.hibernate.query.spi
Interface QueryOptions
-
- All Known Subinterfaces:
MutableQueryOptions
- All Known Implementing Classes:
DelegatingQueryOptions
,LoaderSqlAstCreationState
,MutationQueryOptions
,QueryOptionsAdapter
,QueryOptionsImpl
,SimpleQueryOptions
,SqlOmittingQueryOptions
public interface QueryOptions
Encapsulates options for the execution of a HQL/Criteria/native query
-
-
Field Summary
Fields Modifier and Type Field Description static QueryOptions
NONE
Provide singleton access for frequently needed options:static QueryOptions
READ_ONLY
static QueryOptions
READ_WRITE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AppliedGraph
getAppliedGraph()
JPAEntityGraph
explicitly applied to the query.default CacheMode
getCacheMode()
CacheRetrieveMode
getCacheRetrieveMode()
Controls whether query results are read from the cache.CacheStoreMode
getCacheStoreMode()
Controls whether query results are put into the cache.String
getComment()
The SQL comment to apply to the interpreted SQL query, for dialects which support SQL commentsList<String>
getDatabaseHints()
Hints to apply to the interpreted SQL querySet<String>
getDisabledFetchProfiles()
The explicitly disabled profiles for this querydefault Limit
getEffectiveLimit()
Determine the effective paging limit to apply to the query.Set<String>
getEnabledFetchProfiles()
The explicitly enabled profiles for this queryInteger
getFetchSize()
The fetch size to be applied to the JDBC query.default Integer
getFirstRow()
The first row from the results to returnFlushMode
getFlushMode()
The flush mode to use for the query executionLimit
getLimit()
The limit to the query results.LockOptions
getLockOptions()
Describes the locking to apply to the query resultsdefault Integer
getMaxRows()
The maximum number of rows to return from the resultsBoolean
getQueryPlanCachingEnabled()
Should the query plan of the query be cached?String
getResultCacheRegionName()
The query cache region in which the results should be cached.@Nullable ResultListTransformer<?>
getResultListTransformer()
Transformer applied to the query to transform the structure of the overall resultsInteger
getTimeout()
The timeout to apply to the query.@Nullable TupleTransformer<?>
getTupleTransformer()
Transformer applied to the query to transform the structure of each "row" in the resultsdefault ListResultsConsumer.UniqueSemantic
getUniqueSemantic()
default boolean
hasLimit()
Did the application explicitly request paging limits?Boolean
isReadOnly()
Should entities returned from the query be marked read-only.Boolean
isResultCachingEnabled()
Should results from the query be cached?
-
-
-
Field Detail
-
NONE
static final QueryOptions NONE
Provide singleton access for frequently needed options:
-
READ_WRITE
static final QueryOptions READ_WRITE
-
READ_ONLY
static final QueryOptions READ_ONLY
-
-
Method Detail
-
getTimeout
Integer getTimeout()
The timeout to apply to the query. May also be defined at the transaction level usingTransaction.getTimeout()
-
getFlushMode
FlushMode getFlushMode()
The flush mode to use for the query execution
-
isReadOnly
Boolean isReadOnly()
Should entities returned from the query be marked read-only.
-
getAppliedGraph
AppliedGraph getAppliedGraph()
JPAEntityGraph
explicitly applied to the query.
-
getTupleTransformer
@Nullable TupleTransformer<?> getTupleTransformer()
Transformer applied to the query to transform the structure of each "row" in the results
-
getResultListTransformer
@Nullable ResultListTransformer<?> getResultListTransformer()
Transformer applied to the query to transform the structure of the overall results
-
isResultCachingEnabled
Boolean isResultCachingEnabled()
Should results from the query be cached?- See Also:
getCacheMode()
,getResultCacheRegionName()
-
getCacheRetrieveMode
CacheRetrieveMode getCacheRetrieveMode()
Controls whether query results are read from the cache. No effect unlessisResultCachingEnabled()
returnstrue
- See Also:
CacheMode
-
getCacheStoreMode
CacheStoreMode getCacheStoreMode()
Controls whether query results are put into the cache. No effect unlessisResultCachingEnabled()
returnstrue
- See Also:
CacheMode
-
getCacheMode
default CacheMode getCacheMode()
-
getResultCacheRegionName
String getResultCacheRegionName()
The query cache region in which the results should be cached. No effect unlessisResultCachingEnabled()
returnstrue
-
getQueryPlanCachingEnabled
Boolean getQueryPlanCachingEnabled()
Should the query plan of the query be cached?
-
getEnabledFetchProfiles
Set<String> getEnabledFetchProfiles()
The explicitly enabled profiles for this query
-
getDisabledFetchProfiles
Set<String> getDisabledFetchProfiles()
The explicitly disabled profiles for this query
-
getLockOptions
LockOptions getLockOptions()
Describes the locking to apply to the query results
-
getComment
String getComment()
The SQL comment to apply to the interpreted SQL query, for dialects which support SQL comments
-
getFetchSize
Integer getFetchSize()
The fetch size to be applied to the JDBC query.- See Also:
Statement.getFetchSize()
-
getLimit
Limit getLimit()
The limit to the query results. May also be accessed viagetFirstRow()
andgetMaxRows()
-
getFirstRow
default Integer getFirstRow()
The first row from the results to return- See Also:
getLimit()
-
getMaxRows
default Integer getMaxRows()
The maximum number of rows to return from the results- See Also:
getLimit()
-
getEffectiveLimit
default Limit getEffectiveLimit()
Determine the effective paging limit to apply to the query. If the application did not explicitly specify paging limits,Limit.NONE
is returned- See Also:
getLimit()
-
hasLimit
default boolean hasLimit()
Did the application explicitly request paging limits?- See Also:
getLimit()
-
getUniqueSemantic
default ListResultsConsumer.UniqueSemantic getUniqueSemantic()
-
-