Package org.hibernate.query.internal
Class QueryOptionsImpl
- java.lang.Object
-
- org.hibernate.query.internal.QueryOptionsImpl
-
- All Implemented Interfaces:
AppliedGraph,MutableQueryOptions,QueryOptions
public class QueryOptionsImpl extends Object implements MutableQueryOptions, AppliedGraph
-
-
Field Summary
-
Fields inherited from interface org.hibernate.query.spi.QueryOptions
NONE, READ_ONLY, READ_WRITE
-
-
Constructor Summary
Constructors Constructor Description QueryOptionsImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDatabaseHint(String hint)Corollary toQueryOptions.getDatabaseHints()voidapplyGraph(RootGraphImplementor<?> rootGraph, GraphSemantic graphSemantic)voiddisableFetchProfile(String profileName)voidenableFetchProfile(String profileName)AppliedGraphgetAppliedGraph()JPAEntityGraphexplicitly applied to the query.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 querySet<String>getEnabledFetchProfiles()The explicitly enabled profiles for this queryIntegergetFetchSize()The fetch size to be applied to the JDBC query.FlushModegetFlushMode()The flush mode to use for the query execution@Nullable RootGraphImplementor<?>getGraph()The applied graphLimitgetLimit()The limit to the query results.LockOptionsgetLockOptions()Describes the locking to apply to the query resultsBooleangetQueryPlanCachingEnabled()Should the query plan of the query be cached?StringgetResultCacheRegionName()The query cache region in which the results should be cached.ResultListTransformer<?>getResultListTransformer()Transformer applied to the query to transform the structure of the overall results@Nullable GraphSemanticgetSemantic()The semantic (fetch/load) under which the graph should be appliedIntegergetTimeout()The timeout to apply to the query.TupleTransformer<?>getTupleTransformer()Transformer applied to the query to transform the structure of each "row" in the resultsBooleanisReadOnly()Should entities returned from the query be marked read-only.BooleanisResultCachingEnabled()Should results from the query be cached?voidsetCacheRetrieveMode(CacheRetrieveMode retrieveMode)Corollary toQueryOptions.getCacheRetrieveMode()voidsetCacheStoreMode(CacheStoreMode storeMode)Corollary toQueryOptions.getCacheStoreMode()voidsetComment(String comment)Corollary toQueryOptions.getComment()voidsetFetchSize(int fetchSize)Corollary toQueryOptions.getFetchSize()voidsetFetchSize(Integer fetchSize)voidsetFlushMode(FlushMode flushMode)Corollary toQueryOptions.getFlushMode()voidsetQueryPlanCachingEnabled(Boolean queryPlanCachingEnabled)Corollary toQueryOptions.getQueryPlanCachingEnabled()voidsetReadOnly(boolean readOnly)Corollary toQueryOptions.isReadOnly()voidsetResultCacheRegionName(String resultCacheRegionName)Corollary toQueryOptions.getResultCacheRegionName()voidsetResultCachingEnabled(boolean resultCachingEnabled)Corollary toQueryOptions.isResultCachingEnabled()voidsetResultListTransformer(ResultListTransformer<?> transformer)voidsetTimeout(int timeout)Corollary toQueryOptions.getTimeout()voidsetTimeout(Integer timeout)voidsetTupleTransformer(TupleTransformer<?> transformer)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.query.spi.MutableQueryOptions
setCacheMode
-
Methods inherited from interface org.hibernate.query.spi.QueryOptions
getCacheMode, getEffectiveLimit, getFirstRow, getMaxRows, getUniqueSemantic, hasLimit
-
-
-
-
Method Detail
-
getTimeout
public Integer getTimeout()
Description copied from interface:QueryOptionsThe timeout to apply to the query. May also be defined at the transaction level usingTransaction.getTimeout()- Specified by:
getTimeoutin interfaceQueryOptions
-
setTimeout
public void setTimeout(Integer timeout)
-
getFlushMode
public FlushMode getFlushMode()
Description copied from interface:QueryOptionsThe flush mode to use for the query execution- Specified by:
getFlushModein interfaceQueryOptions
-
setFlushMode
public void setFlushMode(FlushMode flushMode)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getFlushMode()- Specified by:
setFlushModein interfaceMutableQueryOptions
-
getComment
public String getComment()
Description copied from interface:QueryOptionsThe SQL comment to apply to the interpreted SQL query, for dialects which support SQL comments- Specified by:
getCommentin interfaceQueryOptions
-
setComment
public void setComment(String comment)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getComment()- Specified by:
setCommentin interfaceMutableQueryOptions
-
getDatabaseHints
public List<String> getDatabaseHints()
Description copied from interface:QueryOptionsHints to apply to the interpreted SQL query- Specified by:
getDatabaseHintsin interfaceQueryOptions
-
addDatabaseHint
public void addDatabaseHint(String hint)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getDatabaseHints()- Specified by:
addDatabaseHintin interfaceMutableQueryOptions
-
setTupleTransformer
public void setTupleTransformer(TupleTransformer<?> transformer)
- Specified by:
setTupleTransformerin interfaceMutableQueryOptions
-
setResultListTransformer
public void setResultListTransformer(ResultListTransformer<?> transformer)
- Specified by:
setResultListTransformerin interfaceMutableQueryOptions
-
getLimit
public Limit getLimit()
Description copied from interface:QueryOptionsThe limit to the query results. May also be accessed viaQueryOptions.getFirstRow()andQueryOptions.getMaxRows()- Specified by:
getLimitin interfaceQueryOptions
-
getLockOptions
public LockOptions getLockOptions()
Description copied from interface:QueryOptionsDescribes the locking to apply to the query results- Specified by:
getLockOptionsin interfaceQueryOptions
-
getFetchSize
public Integer getFetchSize()
Description copied from interface:QueryOptionsThe fetch size to be applied to the JDBC query.- Specified by:
getFetchSizein interfaceQueryOptions- See Also:
Statement.getFetchSize()
-
setFetchSize
public void setFetchSize(Integer fetchSize)
-
getCacheRetrieveMode
public CacheRetrieveMode getCacheRetrieveMode()
Description copied from interface:QueryOptionsControls whether query results are read from the cache. No effect unlessQueryOptions.isResultCachingEnabled()returnstrue- Specified by:
getCacheRetrieveModein interfaceQueryOptions- See Also:
CacheMode
-
getCacheStoreMode
public CacheStoreMode getCacheStoreMode()
Description copied from interface:QueryOptionsControls whether query results are put into the cache. No effect unlessQueryOptions.isResultCachingEnabled()returnstrue- Specified by:
getCacheStoreModein interfaceQueryOptions- See Also:
CacheMode
-
setCacheRetrieveMode
public void setCacheRetrieveMode(CacheRetrieveMode retrieveMode)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getCacheRetrieveMode()- Specified by:
setCacheRetrieveModein interfaceMutableQueryOptions
-
setCacheStoreMode
public void setCacheStoreMode(CacheStoreMode storeMode)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getCacheStoreMode()- Specified by:
setCacheStoreModein interfaceMutableQueryOptions
-
isResultCachingEnabled
public Boolean isResultCachingEnabled()
Description copied from interface:QueryOptionsShould results from the query be cached?- Specified by:
isResultCachingEnabledin interfaceQueryOptions- See Also:
QueryOptions.getCacheMode(),QueryOptions.getResultCacheRegionName()
-
setResultCachingEnabled
public void setResultCachingEnabled(boolean resultCachingEnabled)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.isResultCachingEnabled()- Specified by:
setResultCachingEnabledin interfaceMutableQueryOptions
-
getResultCacheRegionName
public String getResultCacheRegionName()
Description copied from interface:QueryOptionsThe query cache region in which the results should be cached. No effect unlessQueryOptions.isResultCachingEnabled()returnstrue- Specified by:
getResultCacheRegionNamein interfaceQueryOptions
-
getQueryPlanCachingEnabled
public Boolean getQueryPlanCachingEnabled()
Description copied from interface:QueryOptionsShould the query plan of the query be cached?- Specified by:
getQueryPlanCachingEnabledin interfaceQueryOptions
-
setQueryPlanCachingEnabled
public void setQueryPlanCachingEnabled(Boolean queryPlanCachingEnabled)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getQueryPlanCachingEnabled()- Specified by:
setQueryPlanCachingEnabledin interfaceMutableQueryOptions
-
getTupleTransformer
public TupleTransformer<?> getTupleTransformer()
Description copied from interface:QueryOptionsTransformer applied to the query to transform the structure of each "row" in the results- Specified by:
getTupleTransformerin interfaceQueryOptions
-
getResultListTransformer
public ResultListTransformer<?> getResultListTransformer()
Description copied from interface:QueryOptionsTransformer applied to the query to transform the structure of the overall results- Specified by:
getResultListTransformerin interfaceQueryOptions
-
setResultCacheRegionName
public void setResultCacheRegionName(String resultCacheRegionName)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getResultCacheRegionName()- Specified by:
setResultCacheRegionNamein interfaceMutableQueryOptions
-
setTimeout
public void setTimeout(int timeout)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getTimeout()- Specified by:
setTimeoutin interfaceMutableQueryOptions
-
setFetchSize
public void setFetchSize(int fetchSize)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.getFetchSize()- Specified by:
setFetchSizein interfaceMutableQueryOptions
-
setReadOnly
public void setReadOnly(boolean readOnly)
Description copied from interface:MutableQueryOptionsCorollary toQueryOptions.isReadOnly()- Specified by:
setReadOnlyin interfaceMutableQueryOptions
-
isReadOnly
public Boolean isReadOnly()
Description copied from interface:QueryOptionsShould entities returned from the query be marked read-only.- Specified by:
isReadOnlyin interfaceQueryOptions
-
applyGraph
public void applyGraph(RootGraphImplementor<?> rootGraph, GraphSemantic graphSemantic)
- Specified by:
applyGraphin interfaceMutableQueryOptions
-
enableFetchProfile
public void enableFetchProfile(String profileName)
- Specified by:
enableFetchProfilein interfaceMutableQueryOptions
-
disableFetchProfile
public void disableFetchProfile(String profileName)
- Specified by:
disableFetchProfilein interfaceMutableQueryOptions
-
getEnabledFetchProfiles
public Set<String> getEnabledFetchProfiles()
Description copied from interface:QueryOptionsThe explicitly enabled profiles for this query- Specified by:
getEnabledFetchProfilesin interfaceQueryOptions
-
getDisabledFetchProfiles
public Set<String> getDisabledFetchProfiles()
Description copied from interface:QueryOptionsThe explicitly disabled profiles for this query- Specified by:
getDisabledFetchProfilesin interfaceQueryOptions
-
getAppliedGraph
public AppliedGraph getAppliedGraph()
Description copied from interface:QueryOptionsJPAEntityGraphexplicitly applied to the query.- Specified by:
getAppliedGraphin interfaceQueryOptions
-
getGraph
public @Nullable RootGraphImplementor<?> getGraph()
Description copied from interface:AppliedGraphThe applied graph- Specified by:
getGraphin interfaceAppliedGraph
-
getSemantic
public @Nullable GraphSemantic getSemantic()
Description copied from interface:AppliedGraphThe semantic (fetch/load) under which the graph should be applied- Specified by:
getSemanticin interfaceAppliedGraph
-
-