程序包 org.hibernate
接口 BasicQueryContract<T extends BasicQueryContract>
-
- 所有已知子接口:
CommonQueryContract,NativeQuery<T>,NativeQueryImplementor<T>,ProcedureCall,ProcedureCallImplementor<R>,Query<R>,Query<R>,QueryImplementor<R>,SQLQuery<T>
- 所有已知实现类:
AbstractProducedQuery,CollectionFilterImpl,CriteriaQueryTypeQueryAdapter,NativeQueryImpl,ProcedureCallImpl,QueryImpl
@Deprecated public interface BasicQueryContract<T extends BasicQueryContract>
已过时。(since 5.2) useCommonQueryContractinstead.Defines the aspects of query definition that apply to all forms of querying.- 作者:
- Steve Ebersole
-
-
方法概要
所有方法 实例方法 抽象方法 默认方法 已过时的方法 修饰符和类型 方法 说明 CacheModegetCacheMode()已过时。Obtain the CacheMode in effect for this query.StringgetCacheRegion()已过时。Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion onisCacheable()for more information).IntegergetFetchSize()已过时。Obtain the JDBC fetch size hint in effect for this query.FlushModegetHibernateFlushMode()已过时。Obtain the FlushMode in effect for this query.Type[]getReturnTypes()已过时。(since 5.2) with no replacement; to be removed in 6.0IntegergetTimeout()已过时。Obtain the query timeout in seconds.booleanisCacheable()已过时。Are the results of this query eligible for second level query caching?booleanisReadOnly()已过时。Should entities and proxies loaded by this Query be put in read-only mode?TsetCacheable(boolean cacheable)已过时。Enable/disable second level query (result) caching for this query.TsetCacheMode(CacheMode cacheMode)已过时。(Re)set the current CacheMode in effect for this query.TsetCacheRegion(String cacheRegion)已过时。Set the name of the cache region where query results should be cached (if cached at all).TsetFetchSize(int fetchSize)已过时。Sets a JDBC fetch size hint for the query.default BasicQueryContractsetFlushMode(FlushMode flushMode)已过时。(since 5.2) usesetHibernateFlushMode(org.hibernate.FlushMode)insteadTsetHibernateFlushMode(FlushMode flushMode)已过时。(Re)set the current FlushMode in effect for this query.TsetReadOnly(boolean readOnly)已过时。Set the read-only/modifiable mode for entities and proxies loaded by this Query.TsetTimeout(int timeout)已过时。Set the query timeout in seconds.
-
-
-
方法详细资料
-
setFlushMode
@Deprecated default BasicQueryContract setFlushMode(FlushMode flushMode)
已过时。(since 5.2) usesetHibernateFlushMode(org.hibernate.FlushMode)instead(Re)set the current FlushMode in effect for this query.- 参数:
flushMode- The new FlushMode to use.- 返回:
this, for method chaining- 另请参阅:
getHibernateFlushMode()
-
getHibernateFlushMode
FlushMode getHibernateFlushMode()
已过时。Obtain the FlushMode in effect for this query. By default, the query inherits the FlushMode of the Session from which it originates.- 返回:
- The query FlushMode.
- 另请参阅:
Session.getFlushMode(),FlushMode
-
setHibernateFlushMode
T setHibernateFlushMode(FlushMode flushMode)
已过时。(Re)set the current FlushMode in effect for this query.- 参数:
flushMode- The new FlushMode to use.- 返回:
this, for method chaining- 另请参阅:
getHibernateFlushMode()
-
getCacheMode
CacheMode getCacheMode()
已过时。Obtain the CacheMode in effect for this query. By default, the query inherits the CacheMode of the Session from which is originates. NOTE: The CacheMode here only effects reading/writing of the query cache, not the entity/collection caches.- 返回:
- The query CacheMode.
- 另请参阅:
Session.getCacheMode(),CacheMode
-
setCacheMode
T setCacheMode(CacheMode cacheMode)
已过时。(Re)set the current CacheMode in effect for this query.- 参数:
cacheMode- The new CacheMode to use.- 返回:
this, for method chaining- 另请参阅:
getCacheMode()
-
isCacheable
boolean isCacheable()
已过时。Are the results of this query eligible for second level query caching? This is different than second level caching of any returned entities and collections. NOTE: the query being "eligible" for caching does not necessarily mean its results will be cached. Second level query caching still has to be enabled on theSessionFactoryfor this to happen. Usually that is controlled by thehibernate.cache.use_query_cacheconfiguration setting.- 返回:
trueif the query results are eligible for caching,falseotherwise.- 另请参阅:
AvailableSettings.USE_QUERY_CACHE
-
setCacheable
T setCacheable(boolean cacheable)
已过时。Enable/disable second level query (result) caching for this query.- 参数:
cacheable- Should the query results be cacheable?- 返回:
this, for method chaining- 另请参阅:
isCacheable()
-
getCacheRegion
String getCacheRegion()
已过时。Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion onisCacheable()for more information).nullindicates that the default region should be used.- 返回:
- The specified cache region name into which query results should be placed;
nullindicates the default region.
-
setCacheRegion
T setCacheRegion(String cacheRegion)
已过时。Set the name of the cache region where query results should be cached (if cached at all).- 参数:
cacheRegion- the name of a query cache region, ornullto indicate that the default region should be used.- 返回:
this, for method chaining- 另请参阅:
getCacheRegion()
-
getTimeout
Integer getTimeout()
已过时。Obtain the query timeout in seconds. This value is eventually passed along to the JDBC query viaStatement.setQueryTimeout(int). Zero indicates no timeout.- 返回:
- The timeout in seconds
- 另请参阅:
Statement.getQueryTimeout(),Statement.setQueryTimeout(int)
-
setTimeout
T setTimeout(int timeout)
已过时。Set the query timeout in seconds. NOTE it is important to understand that any value set here is eventually passed directly through to the JDBC Statement which expressly disallows negative values. So negative values should be avoided as a general rule.- 参数:
timeout- the timeout in seconds- 返回:
this, for method chaining- 另请参阅:
getTimeout()
-
getFetchSize
Integer getFetchSize()
已过时。Obtain the JDBC fetch size hint in effect for this query. This value is eventually passed along to the JDBC query viaStatement.setFetchSize(int). As defined by JDBC, this value is a hint to the driver to indicate how many rows to fetch from the database when more rows are needed. NOTE : JDBC expressly defines this value as a hint. It may or may not have any effect on the actual query execution and ResultSet processing depending on the driver.- 返回:
- The timeout in seconds
- 另请参阅:
Statement.getFetchSize(),Statement.setFetchSize(int)
-
setFetchSize
T setFetchSize(int fetchSize)
已过时。Sets a JDBC fetch size hint for the query.- 参数:
fetchSize- the fetch size hint- 返回:
this, for method chaining- 另请参阅:
getFetchSize()
-
isReadOnly
boolean isReadOnly()
已过时。Should entities and proxies loaded by this Query be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.- 返回:
trueif the entities and proxies loaded by the query will be put in read-only mode;falseotherwise (they will be modifiable)- 另请参阅:
setReadOnly(boolean),The read-only/modifiable setting has no impact on entities/proxies returned by the query that existed in the session before the query was executed.
-
setReadOnly
T setReadOnly(boolean readOnly)
已过时。Set the read-only/modifiable mode for entities and proxies loaded by this Query. This setting overrides the default setting for the persistence context.- 参数:
readOnly-trueindicates that entities and proxies loaded by the query are to be put in read-only mode;falseindicates that entities and proxies loaded by the query will be put in modifiable mode- 返回:
this, for method chaining- 另请参阅:
To set the default read-only/modifiable setting used for entities and proxies that are loaded into the session:,PersistenceContext.setDefaultReadOnly(boolean),Read-only entities are not dirty-checked and snapshots of persistent state are not maintained. Read-only entities can be modified, but changes are not persisted. When a proxy is initialized, the loaded entity will have the same read-only/modifiable setting as the uninitialized proxy has, regardless of the session's current setting. The read-only/modifiable setting has no impact on entities/proxies returned by the query that existed in the session before the query was executed.
-
getReturnTypes
@Deprecated Type[] getReturnTypes()
已过时。(since 5.2) with no replacement; to be removed in 6.0Return the Hibernate types of the query results.- 返回:
- an array of types
-
-