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
FieldsModifier and TypeFieldDescriptionstatic final QueryOptions
Provide singleton access for frequently needed options:static final QueryOptions
static final QueryOptions
-
Method Summary
Modifier and TypeMethodDescriptionJPAEntityGraph
explicitly applied to the query.default CacheMode
Controls whether query results are read from the cache.Controls whether query results are put into the cache.The SQL comment to apply to the interpreted SQL query, for dialects which support SQL commentsHints to apply to the interpreted SQL queryThe explicitly disabled profiles for this querydefault Limit
Determine the effective paging limit to apply to the query.The explicitly enabled profiles for this queryThe fetch size to be applied to the JDBC query.default Integer
The first row from the results to returnThe flush mode to use for the query executiongetLimit()
The limit to the query results.Describes the locking to apply to the query resultsdefault Integer
The maximum number of rows to return from the resultsShould the query plan of the query be cached?The query cache region in which the results should be cached.@Nullable ResultListTransformer<?>
Transformer applied to the query to transform the structure of the overall resultsThe timeout to apply to the query.@Nullable TupleTransformer<?>
Transformer applied to the query to transform the structure of each "row" in the resultsdefault boolean
hasLimit()
Did the application explicitly request paging limits?Should entities returned from the query be marked read-only.Should results from the query be cached?
-
Field Details
-
NONE
Provide singleton access for frequently needed options: -
READ_WRITE
-
READ_ONLY
-
-
Method Details
-
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:
-
getCacheRetrieveMode
CacheRetrieveMode getCacheRetrieveMode()Controls whether query results are read from the cache. No effect unlessisResultCachingEnabled()
returnstrue
- See Also:
-
getCacheStoreMode
CacheStoreMode getCacheStoreMode()Controls whether query results are put into the cache. No effect unlessisResultCachingEnabled()
returnstrue
- See Also:
-
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
The explicitly enabled profiles for this query -
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 -
getDatabaseHints
Hints to apply to the interpreted SQL query -
getFetchSize
Integer getFetchSize()The fetch size to be applied to the JDBC query.- See Also:
-
getLimit
Limit getLimit()The limit to the query results. May also be accessed viagetFirstRow()
andgetMaxRows()
-
getFirstRow
The first row from the results to return- See Also:
-
getMaxRows
The maximum number of rows to return from the results- See Also:
-
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:
-
hasLimit
default boolean hasLimit()Did the application explicitly request paging limits?- See Also:
-
getUniqueSemantic
-