Interface QueryOptions
- All Known Subinterfaces:
MutableQueryOptions
- All Known Implementing Classes:
DelegatingQueryOptions, QueryOptionsAdapter
public interface QueryOptions
Encapsulates options for the execution of a query.
- API Note:
- Note that not all options are relevant for every type of query.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final QueryOptionsProvide singleton access for a frequently needed option.static final QueryOptionsstatic final QueryOptions -
Method Summary
Modifier and TypeMethodDescriptionAnEntityGraphexplicitly applied to the query.default CacheModeControls 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 comments.Hints to apply to the interpreted SQL query.The explicitly disabled profiles for this query.default LimitDetermine the effective paging limit to apply to the query.The explicitly enabled profiles for this query.The fetch size to be applied to the JDBC query.default IntegerThe first row from the results to return.getLimit()The limit to the query results.Describes the locking to apply to the query results.default IntegerThe maximum number of rows to return from the results.The flush mode to use for the query execution.Should the query plan of the query be cached?The query cache region in which the results should be cached.Transformer applied to the query to transform the structure of the overall result list.The query execution timeout.Transformer applied to the query to transform the structure of each "row" of the results.default booleanhasLimit()Did the application explicitly request paging limits?default BooleanWhether top-level HQL/criteria pagination should be handled in memory instead of by the SQL query.Are entities returned by the query marked as read-only?Should results from the query be cached?default booleanWhether this execution goes throughscroll()/getResultStream()and therefore needs SQL row ordering stable enough for scroll-style result grouping.default LimitThe originalLimitas set by the application, before any wrapper (SqlOmittingQueryOptionsor the scroll execution context) hid it fromgetLimit().
-
Field Details
-
NONE
Provide singleton access for a frequently needed option. -
READ_WRITE
-
READ_ONLY
-
-
Method Details
-
getTimeout
The query execution timeout. May alternatively be specified at the transaction level usingTransaction.getTimeout(). -
getQueryFlushMode
The flush mode to use for the query execution. -
isReadOnly
-
getAppliedGraph
AnEntityGraphexplicitly applied to the query. -
getTupleTransformer
Transformer applied to the query to transform the structure of each "row" of the results. -
getResultListTransformer
Transformer applied to the query to transform the structure of the overall result list. -
isResultCachingEnabled
-
getCacheRetrieveMode
Controls whether query results are read from the cache. Has no effect unlessisResultCachingEnabled()returnstrue- See Also:
-
getCacheStoreMode
Controls whether query results are put into the cache. Has no effect unlessisResultCachingEnabled()returnstrue.- See Also:
-
getCacheMode
-
getResultCacheRegionName
The query cache region in which the results should be cached. Has no effect unlessisResultCachingEnabled()returnstrue. -
getQueryPlanCachingEnabled
-
isLimitInMemoryEnabled
-
getEnabledFetchProfiles
-
getDisabledFetchProfiles
-
getLockOptions
Describes the locking to apply to the query results. -
getComment
-
getDatabaseHints
-
getFetchSize
-
getLimit
The limit to the query results. May also be accessed viagetFirstRow()andgetMaxRows(). -
peekOriginalLimit
The originalLimitas set by the application, before any wrapper (SqlOmittingQueryOptionsor the scroll execution context) hid it fromgetLimit(). Used by runtime parameter binders that the SQM-to-SQL converter pushed into the SQL AST so they can bind the original value even whengetLimit()has been intentionally suppressed for SQL rendering. -
getFirstRow
-
getMaxRows
-
getEffectiveLimit
Determine the effective paging limit to apply to the query. If the application did not explicitly specify paging limits,Limit.NONEis returned.- See Also:
-
hasLimit
default boolean hasLimit()Did the application explicitly request paging limits?- See Also:
-
getUniqueSemantic
-
isScrollExecution
default boolean isScrollExecution()Whether this execution goes throughscroll()/getResultStream()and therefore needs SQL row ordering stable enough for scroll-style result grouping.
-