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 void
addDatabaseHint(String hint)
Corollary toQueryOptions.getDatabaseHints()
void
applyGraph(RootGraphImplementor<?> rootGraph, GraphSemantic graphSemantic)
void
disableFetchProfile(String profileName)
void
enableFetchProfile(String profileName)
AppliedGraph
getAppliedGraph()
JPAEntityGraph
explicitly applied to the query.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 querySet<String>
getEnabledFetchProfiles()
The explicitly enabled profiles for this queryInteger
getFetchSize()
The fetch size to be applied to the JDBC query.FlushMode
getFlushMode()
The flush mode to use for the query execution@Nullable RootGraphImplementor<?>
getGraph()
The applied graphLimit
getLimit()
The limit to the query results.LockOptions
getLockOptions()
Describes the locking to apply to the query resultsBoolean
getQueryPlanCachingEnabled()
Should the query plan of the query be cached?String
getResultCacheRegionName()
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 GraphSemantic
getSemantic()
The semantic (fetch/load) under which the graph should be appliedInteger
getTimeout()
The timeout to apply to the query.TupleTransformer<?>
getTupleTransformer()
Transformer applied to the query to transform the structure of each "row" in the resultsBoolean
isReadOnly()
Should entities returned from the query be marked read-only.Boolean
isResultCachingEnabled()
Should results from the query be cached?void
setCacheRetrieveMode(CacheRetrieveMode retrieveMode)
Corollary toQueryOptions.getCacheRetrieveMode()
void
setCacheStoreMode(CacheStoreMode storeMode)
Corollary toQueryOptions.getCacheStoreMode()
void
setComment(String comment)
Corollary toQueryOptions.getComment()
void
setFetchSize(int fetchSize)
Corollary toQueryOptions.getFetchSize()
void
setFetchSize(Integer fetchSize)
void
setFlushMode(FlushMode flushMode)
Corollary toQueryOptions.getFlushMode()
void
setQueryPlanCachingEnabled(Boolean queryPlanCachingEnabled)
Corollary toQueryOptions.getQueryPlanCachingEnabled()
void
setReadOnly(boolean readOnly)
Corollary toQueryOptions.isReadOnly()
void
setResultCacheRegionName(String resultCacheRegionName)
Corollary toQueryOptions.getResultCacheRegionName()
void
setResultCachingEnabled(boolean resultCachingEnabled)
Corollary toQueryOptions.isResultCachingEnabled()
void
setResultListTransformer(ResultListTransformer<?> transformer)
void
setTimeout(int timeout)
Corollary toQueryOptions.getTimeout()
void
setTimeout(Integer timeout)
void
setTupleTransformer(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:QueryOptions
The timeout to apply to the query. May also be defined at the transaction level usingTransaction.getTimeout()
- Specified by:
getTimeout
in interfaceQueryOptions
-
setTimeout
public void setTimeout(Integer timeout)
-
getFlushMode
public FlushMode getFlushMode()
Description copied from interface:QueryOptions
The flush mode to use for the query execution- Specified by:
getFlushMode
in interfaceQueryOptions
-
setFlushMode
public void setFlushMode(FlushMode flushMode)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getFlushMode()
- Specified by:
setFlushMode
in interfaceMutableQueryOptions
-
getComment
public String getComment()
Description copied from interface:QueryOptions
The SQL comment to apply to the interpreted SQL query, for dialects which support SQL comments- Specified by:
getComment
in interfaceQueryOptions
-
setComment
public void setComment(String comment)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getComment()
- Specified by:
setComment
in interfaceMutableQueryOptions
-
getDatabaseHints
public List<String> getDatabaseHints()
Description copied from interface:QueryOptions
Hints to apply to the interpreted SQL query- Specified by:
getDatabaseHints
in interfaceQueryOptions
-
addDatabaseHint
public void addDatabaseHint(String hint)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getDatabaseHints()
- Specified by:
addDatabaseHint
in interfaceMutableQueryOptions
-
setTupleTransformer
public void setTupleTransformer(TupleTransformer<?> transformer)
- Specified by:
setTupleTransformer
in interfaceMutableQueryOptions
-
setResultListTransformer
public void setResultListTransformer(ResultListTransformer<?> transformer)
- Specified by:
setResultListTransformer
in interfaceMutableQueryOptions
-
getLimit
public Limit getLimit()
Description copied from interface:QueryOptions
The limit to the query results. May also be accessed viaQueryOptions.getFirstRow()
andQueryOptions.getMaxRows()
- Specified by:
getLimit
in interfaceQueryOptions
-
getLockOptions
public LockOptions getLockOptions()
Description copied from interface:QueryOptions
Describes the locking to apply to the query results- Specified by:
getLockOptions
in interfaceQueryOptions
-
getFetchSize
public Integer getFetchSize()
Description copied from interface:QueryOptions
The fetch size to be applied to the JDBC query.- Specified by:
getFetchSize
in interfaceQueryOptions
- See Also:
Statement.getFetchSize()
-
setFetchSize
public void setFetchSize(Integer fetchSize)
-
getCacheRetrieveMode
public CacheRetrieveMode getCacheRetrieveMode()
Description copied from interface:QueryOptions
Controls whether query results are read from the cache. No effect unlessQueryOptions.isResultCachingEnabled()
returnstrue
- Specified by:
getCacheRetrieveMode
in interfaceQueryOptions
- See Also:
CacheMode
-
getCacheStoreMode
public CacheStoreMode getCacheStoreMode()
Description copied from interface:QueryOptions
Controls whether query results are put into the cache. No effect unlessQueryOptions.isResultCachingEnabled()
returnstrue
- Specified by:
getCacheStoreMode
in interfaceQueryOptions
- See Also:
CacheMode
-
setCacheRetrieveMode
public void setCacheRetrieveMode(CacheRetrieveMode retrieveMode)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getCacheRetrieveMode()
- Specified by:
setCacheRetrieveMode
in interfaceMutableQueryOptions
-
setCacheStoreMode
public void setCacheStoreMode(CacheStoreMode storeMode)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getCacheStoreMode()
- Specified by:
setCacheStoreMode
in interfaceMutableQueryOptions
-
isResultCachingEnabled
public Boolean isResultCachingEnabled()
Description copied from interface:QueryOptions
Should results from the query be cached?- Specified by:
isResultCachingEnabled
in interfaceQueryOptions
- See Also:
QueryOptions.getCacheMode()
,QueryOptions.getResultCacheRegionName()
-
setResultCachingEnabled
public void setResultCachingEnabled(boolean resultCachingEnabled)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.isResultCachingEnabled()
- Specified by:
setResultCachingEnabled
in interfaceMutableQueryOptions
-
getResultCacheRegionName
public String getResultCacheRegionName()
Description copied from interface:QueryOptions
The query cache region in which the results should be cached. No effect unlessQueryOptions.isResultCachingEnabled()
returnstrue
- Specified by:
getResultCacheRegionName
in interfaceQueryOptions
-
getQueryPlanCachingEnabled
public Boolean getQueryPlanCachingEnabled()
Description copied from interface:QueryOptions
Should the query plan of the query be cached?- Specified by:
getQueryPlanCachingEnabled
in interfaceQueryOptions
-
setQueryPlanCachingEnabled
public void setQueryPlanCachingEnabled(Boolean queryPlanCachingEnabled)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getQueryPlanCachingEnabled()
- Specified by:
setQueryPlanCachingEnabled
in interfaceMutableQueryOptions
-
getTupleTransformer
public TupleTransformer<?> getTupleTransformer()
Description copied from interface:QueryOptions
Transformer applied to the query to transform the structure of each "row" in the results- Specified by:
getTupleTransformer
in interfaceQueryOptions
-
getResultListTransformer
public ResultListTransformer<?> getResultListTransformer()
Description copied from interface:QueryOptions
Transformer applied to the query to transform the structure of the overall results- Specified by:
getResultListTransformer
in interfaceQueryOptions
-
setResultCacheRegionName
public void setResultCacheRegionName(String resultCacheRegionName)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getResultCacheRegionName()
- Specified by:
setResultCacheRegionName
in interfaceMutableQueryOptions
-
setTimeout
public void setTimeout(int timeout)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getTimeout()
- Specified by:
setTimeout
in interfaceMutableQueryOptions
-
setFetchSize
public void setFetchSize(int fetchSize)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.getFetchSize()
- Specified by:
setFetchSize
in interfaceMutableQueryOptions
-
setReadOnly
public void setReadOnly(boolean readOnly)
Description copied from interface:MutableQueryOptions
Corollary toQueryOptions.isReadOnly()
- Specified by:
setReadOnly
in interfaceMutableQueryOptions
-
isReadOnly
public Boolean isReadOnly()
Description copied from interface:QueryOptions
Should entities returned from the query be marked read-only.- Specified by:
isReadOnly
in interfaceQueryOptions
-
applyGraph
public void applyGraph(RootGraphImplementor<?> rootGraph, GraphSemantic graphSemantic)
- Specified by:
applyGraph
in interfaceMutableQueryOptions
-
enableFetchProfile
public void enableFetchProfile(String profileName)
- Specified by:
enableFetchProfile
in interfaceMutableQueryOptions
-
disableFetchProfile
public void disableFetchProfile(String profileName)
- Specified by:
disableFetchProfile
in interfaceMutableQueryOptions
-
getEnabledFetchProfiles
public Set<String> getEnabledFetchProfiles()
Description copied from interface:QueryOptions
The explicitly enabled profiles for this query- Specified by:
getEnabledFetchProfiles
in interfaceQueryOptions
-
getDisabledFetchProfiles
public Set<String> getDisabledFetchProfiles()
Description copied from interface:QueryOptions
The explicitly disabled profiles for this query- Specified by:
getDisabledFetchProfiles
in interfaceQueryOptions
-
getAppliedGraph
public AppliedGraph getAppliedGraph()
Description copied from interface:QueryOptions
JPAEntityGraph
explicitly applied to the query.- Specified by:
getAppliedGraph
in interfaceQueryOptions
-
getGraph
public @Nullable RootGraphImplementor<?> getGraph()
Description copied from interface:AppliedGraph
The applied graph- Specified by:
getGraph
in interfaceAppliedGraph
-
getSemantic
public @Nullable GraphSemantic getSemantic()
Description copied from interface:AppliedGraph
The semantic (fetch/load) under which the graph should be applied- Specified by:
getSemantic
in interfaceAppliedGraph
-
-