Package org.hibernate.query.spi
Interface QueryOptions
-
- All Known Subinterfaces:
MutableQueryOptions
- All Known Implementing Classes:
DelegatingQueryOptions,LoaderSqlAstCreationState,MutationQueryOptions,QueryOptionsAdapter,QueryOptionsImpl,SimpleQueryOptions,SqlOmittingQueryOptions
public interface QueryOptionsEncapsulates options for the execution of a HQL/Criteria/native query
-
-
Field Summary
Fields Modifier and Type Field Description static QueryOptionsNONEProvide singleton access for frequently needed options:static QueryOptionsREAD_ONLYstatic QueryOptionsREAD_WRITE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AppliedGraphgetAppliedGraph()JPAEntityGraphexplicitly applied to the query.default CacheModegetCacheMode()CacheRetrieveModegetCacheRetrieveMode()Controls whether query results are read from the cache.CacheStoreModegetCacheStoreMode()Controls whether query results are put into the cache.StringgetComment()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 LimitgetEffectiveLimit()Determine the effective paging limit to apply to the query.Set<String>getEnabledFetchProfiles()The explicitly enabled profiles for this queryIntegergetFetchSize()The fetch size to be applied to the JDBC query.default IntegergetFirstRow()The first row from the results to returnFlushModegetFlushMode()The flush mode to use for the query executionLimitgetLimit()The limit to the query results.LockOptionsgetLockOptions()Describes the locking to apply to the query resultsdefault IntegergetMaxRows()The maximum number of rows to return from the resultsBooleangetQueryPlanCachingEnabled()Should the query plan of the query be cached?StringgetResultCacheRegionName()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 resultsIntegergetTimeout()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.UniqueSemanticgetUniqueSemantic()default booleanhasLimit()Did the application explicitly request paging limits?BooleanisReadOnly()Should entities returned from the query be marked read-only.BooleanisResultCachingEnabled()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()
JPAEntityGraphexplicitly 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.NONEis returned- See Also:
getLimit()
-
hasLimit
default boolean hasLimit()
Did the application explicitly request paging limits?- See Also:
getLimit()
-
getUniqueSemantic
default ListResultsConsumer.UniqueSemantic getUniqueSemantic()
-
-