类 CriteriaQueryTypeQueryAdapter<X>
- java.lang.Object
-
- org.hibernate.query.criteria.internal.compile.CriteriaQueryTypeQueryAdapter<X>
-
- 所有已实现的接口:
javax.persistence.Query,javax.persistence.TypedQuery<X>,BasicQueryContract<CommonQueryContract>,Query<X>,CommonQueryContract,Query<X>,QueryImplementor<X>
public class CriteriaQueryTypeQueryAdapter<X> extends Object implements QueryImplementor<X>
Make this go away in 6.0 :) Needed because atm we render a JPA Criteria query into a HQL/JPQL query String and some metadata, and then compile into a Query. This class wraps the compiled HQL/JPQL query and adds an extra layer of metadata. But the move to SQM in 6.0 allows us to do away with the "wrapping". Essentially- 作者:
- Steve Ebersole
-
-
构造器概要
构造器 构造器 说明 CriteriaQueryTypeQueryAdapter(SharedSessionContractImplementor entityManager, QueryImplementor<X> jpqlQuery, Map<javax.persistence.criteria.ParameterExpression<?>,ExplicitParameterInfo<?>> explicitParameterInfoMap)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 QueryImplementoraddQueryHint(String hint)Add a DB query hint to the SQL.QueryImplementor<X>applyGraph(RootGraph graph, GraphSemantic semantic)Apply the given graph using the given semanticTypedetermineProperBooleanType(int position, Object value, Type defaultType)TypedetermineProperBooleanType(String name, Object value, Type defaultType)intexecuteUpdate()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 onQuery.isCacheable()for more information).StringgetComment()Obtain the comment currently associated with this query.IntegergetFetchSize()Obtain the JDBC fetch size hint in effect for this query.intgetFirstResult()javax.persistence.FlushModeTypegetFlushMode()For users of the Hibernate native APIs, we've had to rename this method as defined by Hibernate historically because the JPA contract defines a method of the same name, but returning the JPAFlushModeTyperather than Hibernate'sFlushMode.FlushModegetHibernateFlushMode()Obtain the FlushMode in effect for this query.Map<String,Object>getHints()javax.persistence.LockModeTypegetLockMode()LockOptionsgetLockOptions()Obtains the LockOptions in effect for this query.intgetMaxResults()String[]getNamedParameters()Return the names of all named parameters of the query.javax.persistence.Parameter<?>getParameter(int position)<T> javax.persistence.Parameter<T>getParameter(int position, Class<T> type)javax.persistence.Parameter<?>getParameter(String name)<T> javax.persistence.Parameter<T>getParameter(String name, Class<T> type)ParameterMetadatagetParameterMetadata()Access to information about query parameters.Set<javax.persistence.Parameter<?>>getParameters()ObjectgetParameterValue(int position)ObjectgetParameterValue(String name)<T> TgetParameterValue(javax.persistence.Parameter<T> param)QueryProducerImplementorgetProducer()Get the QueryProducer this Query originates from.RowSelectiongetQueryOptions()"QueryOptions" is a better name, I think, than "RowSelection" -> 6.0StringgetQueryString()Get the query string.List<X>getResultList()String[]getReturnAliases()Type[]getReturnTypes()Return the Hibernate types of the query results.XgetSingleResult()IntegergetTimeout()Obtain the query timeout in seconds.booleanisBound(javax.persistence.Parameter<?> param)booleanisCacheable()Are the results of this query eligible for second level query caching?protected booleanisNativeQuery()booleanisReadOnly()Should entities and proxies loaded by this Query be put in read-only mode?Iterator<X>iterate()Return the query results as an Iterator.List<X>list()Return the query results as a List.ScrollableResultsscroll()Return the query results as ScrollableResults.ScrollableResultsscroll(ScrollMode scrollMode)Return the query results as ScrollableResults.QueryImplementorsetCacheable(boolean cacheable)Enable/disable second level query (result) caching for this query.QueryImplementor<X>setCacheMode(CacheMode cacheMode)(Re)set the current CacheMode in effect for this query.QueryImplementorsetCacheRegion(String cacheRegion)Set the name of the cache region where query results should be cached (if cached at all).QueryImplementorsetComment(String comment)Set the comment for this query.QueryImplementor<X>setEntity(int position, Object val)Bind an instance of a mapped persistent class to a JDBC-style query parameter.QueryImplementor<X>setEntity(String name, Object val)Bind an instance of a mapped persistent class to a named query parameter.QueryImplementorsetFetchSize(int fetchSize)Sets a JDBC fetch size hint for the query.QueryImplementor<X>setFirstResult(int i)QueryImplementor<X>setFlushMode(javax.persistence.FlushModeType flushModeType)QueryImplementorsetFlushMode(FlushMode flushMode)(Re)set the current FlushMode in effect for this query.QueryImplementor<X>setHibernateFlushMode(FlushMode flushMode)(Re)set the current FlushMode in effect for this query.QueryImplementor<X>setHint(String name, Object value)QueryImplementorsetLockMode(String alias, LockMode lockMode)Set the LockMode to use for specific alias (as defined in the query's FROM clause).QueryImplementor<X>setLockMode(javax.persistence.LockModeType lockModeType)QueryImplementorsetLockOptions(LockOptions lockOptions)Set the lock options for the query.QueryImplementor<X>setMaxResults(int maxResult)voidsetOptionalEntityName(String entityName)voidsetOptionalId(Serializable id)voidsetOptionalObject(Object optionalObject)QueryImplementor<X>setParameter(int i, Object o)Bind a positional query parameter using its inferred Type.QueryImplementor<X>setParameter(int position, Object val, Type type)Bind a value to a JDBC-style query parameter.QueryImplementor<X>setParameter(int position, Instant value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(int position, LocalDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(int position, OffsetDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(int position, ZonedDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(int i, Calendar calendar, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(int i, Date date, javax.persistence.TemporalType temporalType)<P> QueryImplementor<X>setParameter(int position, P val, javax.persistence.TemporalType temporalType)Bind a positional query parameter as some form of date/time using the indicated temporal-type.QueryImplementor<X>setParameter(String name, Object value)Bind a named query parameter using its inferred Type.QueryImplementor<X>setParameter(String name, Object val, Type type)Bind a named query parameter using the supplied TypeQueryImplementor<X>setParameter(String name, Instant value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(String name, LocalDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(String name, OffsetDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(String name, ZonedDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(String name, Calendar calendar, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(String name, Date date, javax.persistence.TemporalType temporalType)<P> QueryImplementor<X>setParameter(String name, P val, javax.persistence.TemporalType temporalType)Bind a named query parameter as some form of date/time using the indicated temporal-type.QueryImplementor<X>setParameter(javax.persistence.Parameter<Instant> param, Instant value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(javax.persistence.Parameter<LocalDateTime> param, LocalDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(javax.persistence.Parameter<OffsetDateTime> param, OffsetDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(javax.persistence.Parameter<ZonedDateTime> param, ZonedDateTime value, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(javax.persistence.Parameter<Calendar> param, Calendar calendar, javax.persistence.TemporalType temporalType)QueryImplementor<X>setParameter(javax.persistence.Parameter<Date> param, Date date, javax.persistence.TemporalType temporalType)<T> QueryImplementor<X>setParameter(javax.persistence.Parameter<T> param, T t)<P> QueryImplementor<X>setParameter(QueryParameter<P> parameter, P val, javax.persistence.TemporalType temporalType)Bind a query parameter as some form of date/time using the indicated temporal-type.<P> QueryImplementor<X>setParameter(QueryParameter<P> parameter, P value, Type type)Bind a query parameter using the supplied Type<T> QueryImplementor<X>setParameter(QueryParameter<T> parameter, T val)Bind a query parameter using its inferred Type.Query<X>setParameterList(int position, Object[] values)Query<X>setParameterList(int position, Object[] values, Type type)Query<X>setParameterList(int position, Collection values)Query<X>setParameterList(int position, Collection values, Type type)QueryImplementor<X>setParameterList(String name, Object[] values)Bind multiple values to a named query parameter.QueryImplementor<X>setParameterList(String name, Object[] values, Type type)Bind multiple values to a named query parameter.QueryImplementor<X>setParameterList(String name, Collection values)Bind multiple values to a named query parameter.QueryImplementor<X>setParameterList(String name, Collection values, Type type)Bind multiple values to a named query parameter.<P> QueryImplementor<X>setParameterList(QueryParameter<P> parameter, Collection<P> values)Bind multiple values to a query parameter using its inferred Type.QueryImplementor<X>setProperties(Object bean)Bind the property values of the given bean to named parameters of the query, matching property names with parameter names and mapping property types to Hibernate types using heuristics.QueryImplementorsetProperties(Map map)Bind the values of the given Map for each named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.QueryImplementorsetReadOnly(boolean readOnly)Set the read-only/modifiable mode for entities and proxies loaded by this Query.QueryImplementor<X>setResultTransformer(ResultTransformer transformer)Set a strategy for handling the query results.QueryImplementorsetTimeout(int timeout)Set the query timeout in seconds.Stream<X>stream()Retrieve a Stream over the query results.XuniqueResult()Convenience method to return a single instance that matches the query, ornullif the query returns no results.Optional<X>uniqueResultOptional()<T> Tunwrap(Class<T> cls)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.Query
getHibernateFirstResult, getHibernateMaxResults, setHibernateFirstResult, setHibernateMaxResults
-
从接口继承的方法 org.hibernate.query.Query
applyFetchGraph, applyLoadGraph, getResultStream, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setDate, setDate, setDouble, setDouble, setFloat, setFloat, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setParameters, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimestamp, setTimestamp
-
-
-
-
构造器详细资料
-
CriteriaQueryTypeQueryAdapter
public CriteriaQueryTypeQueryAdapter(SharedSessionContractImplementor entityManager, QueryImplementor<X> jpqlQuery, Map<javax.persistence.criteria.ParameterExpression<?>,ExplicitParameterInfo<?>> explicitParameterInfoMap)
-
-
方法详细资料
-
getResultList
public List<X> getResultList()
- 指定者:
getResultList在接口中javax.persistence.Query- 指定者:
getResultList在接口中Query<X>- 指定者:
getResultList在接口中javax.persistence.TypedQuery<X>
-
uniqueResult
public X uniqueResult()
从接口复制的说明:QueryConvenience method to return a single instance that matches the query, ornullif the query returns no results.- 指定者:
uniqueResult在接口中Query<X>- 指定者:
uniqueResult在接口中Query<X>- 返回:
- the single result or null
-
uniqueResultOptional
public Optional<X> uniqueResultOptional()
- 指定者:
uniqueResultOptional在接口中Query<X>
-
stream
public Stream<X> stream()
从接口复制的说明:QueryRetrieve a Stream over the query results. In the initial implementation (5.2) this returns a simple sequential Stream. The plan is to return a a smarter stream in 6.x leveraging the SQM model.You should call
BaseStream.close()after processing the stream so that the underlying resources are deallocated right away.
-
list
public List<X> list()
从接口复制的说明:QueryReturn the query results as a List. If the query contains multiple results per row, the results are returned in an instance of Object[].
-
setCacheMode
public QueryImplementor<X> setCacheMode(CacheMode cacheMode)
从接口复制的说明:Query(Re)set the current CacheMode in effect for this query.- 指定者:
setCacheMode在接口中BasicQueryContract<X>- 指定者:
setCacheMode在接口中Query<X>- 指定者:
setCacheMode在接口中Query<X>- 参数:
cacheMode- The new CacheMode to use.- 返回:
this, for method chaining- 另请参阅:
Query.getCacheMode()
-
isCacheable
public boolean isCacheable()
从接口复制的说明:QueryAre 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.- 指定者:
isCacheable在接口中BasicQueryContract<X>- 指定者:
isCacheable在接口中Query<X>- 返回:
trueif the query results are eligible for caching,falseotherwise.- 另请参阅:
AvailableSettings.USE_QUERY_CACHE
-
getSingleResult
public X getSingleResult()
- 指定者:
getSingleResult在接口中javax.persistence.Query- 指定者:
getSingleResult在接口中Query<X>- 指定者:
getSingleResult在接口中javax.persistence.TypedQuery<X>
-
getParameterMetadata
public ParameterMetadata getParameterMetadata()
从接口复制的说明:QueryAccess to information about query parameters.- 指定者:
getParameterMetadata在接口中Query<X>- 指定者:
getParameterMetadata在接口中Query<X>- 返回:
- information about query parameters.
-
getNamedParameters
public String[] getNamedParameters()
从接口复制的说明:QueryReturn the names of all named parameters of the query.- 指定者:
getNamedParameters在接口中Query<X>- 返回:
- the parameter names, in no particular order
-
getMaxResults
public int getMaxResults()
- 指定者:
getMaxResults在接口中javax.persistence.Query
-
setMaxResults
public QueryImplementor<X> setMaxResults(int maxResult)
- 指定者:
setMaxResults在接口中javax.persistence.Query- 指定者:
setMaxResults在接口中Query<X>- 指定者:
setMaxResults在接口中Query<X>- 指定者:
setMaxResults在接口中javax.persistence.TypedQuery<X>
-
getFirstResult
public int getFirstResult()
- 指定者:
getFirstResult在接口中javax.persistence.Query
-
setFirstResult
public QueryImplementor<X> setFirstResult(int i)
- 指定者:
setFirstResult在接口中javax.persistence.Query- 指定者:
setFirstResult在接口中Query<X>- 指定者:
setFirstResult在接口中Query<X>- 指定者:
setFirstResult在接口中javax.persistence.TypedQuery<X>
-
setHint
public QueryImplementor<X> setHint(String name, Object value)
-
applyGraph
public QueryImplementor<X> applyGraph(RootGraph graph, GraphSemantic semantic)
从接口复制的说明:QueryApply the given graph using the given semantic- 指定者:
applyGraph在接口中Query<X>- 参数:
graph- The graph the apply.semantic- The semantic to use when applying the graph- 返回:
- this - for method chaining
-
isNativeQuery
protected boolean isNativeQuery()
-
getQueryString
public String getQueryString()
从接口复制的说明:QueryGet the query string.- 指定者:
getQueryString在接口中Query<X>- 指定者:
getQueryString在接口中Query<X>- 返回:
- the query string
-
getHibernateFlushMode
public FlushMode getHibernateFlushMode()
从接口复制的说明:QueryObtain the FlushMode in effect for this query. By default, the query inherits the FlushMode of the Session from which it originates.- 指定者:
getHibernateFlushMode在接口中BasicQueryContract<X>- 指定者:
getHibernateFlushMode在接口中Query<X>- 指定者:
getHibernateFlushMode在接口中Query<X>- 返回:
- The query FlushMode.
- 另请参阅:
FlushMode
-
getFlushMode
public javax.persistence.FlushModeType getFlushMode()
从接口复制的说明:QueryFor users of the Hibernate native APIs, we've had to rename this method as defined by Hibernate historically because the JPA contract defines a method of the same name, but returning the JPAFlushModeTyperather than Hibernate'sFlushMode. For the former behavior, useQuery.getHibernateFlushMode()instead.- 指定者:
getFlushMode在接口中javax.persistence.Query- 指定者:
getFlushMode在接口中Query<X>- 返回:
- The FlushModeType in effect for this query.
-
getCacheMode
public CacheMode getCacheMode()
从接口复制的说明:QueryObtain 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.- 指定者:
getCacheMode在接口中BasicQueryContract<X>- 指定者:
getCacheMode在接口中Query<X>- 指定者:
getCacheMode在接口中Query<X>- 返回:
- The query CacheMode.
- 另请参阅:
Session.getCacheMode(),CacheMode
-
getReturnTypes
public Type[] getReturnTypes()
从接口复制的说明:QueryReturn the Hibernate types of the query results.- 指定者:
getReturnTypes在接口中BasicQueryContract<X>- 指定者:
getReturnTypes在接口中Query<X>- 返回:
- an array of types
-
getLockOptions
public LockOptions getLockOptions()
从接口复制的说明:QueryObtains the LockOptions in effect for this query.- 指定者:
getLockOptions在接口中Query<X>- 指定者:
getLockOptions在接口中Query<X>- 返回:
- The LockOptions
- 另请参阅:
LockOptions
-
getQueryOptions
public RowSelection getQueryOptions()
从接口复制的说明:Query"QueryOptions" is a better name, I think, than "RowSelection" -> 6.0- 指定者:
getQueryOptions在接口中Query<X>- 返回:
- Return the encapsulation of this query's options, which includes access to firstRow, maxRows, timeout and fetchSize. Important because this gives access to those values in their Integer form rather than the primitive form (int) required by JPA.
-
setFlushMode
public QueryImplementor<X> setFlushMode(javax.persistence.FlushModeType flushModeType)
- 指定者:
setFlushMode在接口中javax.persistence.Query- 指定者:
setFlushMode在接口中Query<X>- 指定者:
setFlushMode在接口中Query<X>- 指定者:
setFlushMode在接口中javax.persistence.TypedQuery<X>
-
setFlushMode
public QueryImplementor setFlushMode(FlushMode flushMode)
从接口复制的说明:Query(Re)set the current FlushMode in effect for this query.- 指定者:
setFlushMode在接口中BasicQueryContract<X>- 指定者:
setFlushMode在接口中Query<X>- 指定者:
setFlushMode在接口中Query<X>- 参数:
flushMode- The new FlushMode to use.- 返回:
this, for method chaining- 另请参阅:
Query.getHibernateFlushMode()
-
setHibernateFlushMode
public QueryImplementor<X> setHibernateFlushMode(FlushMode flushMode)
从接口复制的说明:Query(Re)set the current FlushMode in effect for this query.- 指定者:
setHibernateFlushMode在接口中BasicQueryContract<X>- 指定者:
setHibernateFlushMode在接口中Query<X>- 指定者:
setHibernateFlushMode在接口中Query<X>- 参数:
flushMode- The new FlushMode to use.- 返回:
this, for method chaining- 另请参阅:
Query.getHibernateFlushMode()
-
setCacheable
public QueryImplementor setCacheable(boolean cacheable)
从接口复制的说明:QueryEnable/disable second level query (result) caching for this query.- 指定者:
setCacheable在接口中BasicQueryContract<X>- 指定者:
setCacheable在接口中Query<X>- 指定者:
setCacheable在接口中Query<X>- 参数:
cacheable- Should the query results be cacheable?- 返回:
this, for method chaining- 另请参阅:
Query.isCacheable()
-
getCacheRegion
public String getCacheRegion()
从接口复制的说明:QueryObtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion onQuery.isCacheable()for more information).nullindicates that the default region should be used.- 指定者:
getCacheRegion在接口中BasicQueryContract<X>- 指定者:
getCacheRegion在接口中Query<X>- 指定者:
getCacheRegion在接口中Query<X>- 返回:
- The specified cache region name into which query results should be placed;
nullindicates the default region.
-
setCacheRegion
public QueryImplementor setCacheRegion(String cacheRegion)
从接口复制的说明:QuerySet the name of the cache region where query results should be cached (if cached at all).- 指定者:
setCacheRegion在接口中BasicQueryContract<X>- 指定者:
setCacheRegion在接口中Query<X>- 指定者:
setCacheRegion在接口中Query<X>- 参数:
cacheRegion- the name of a query cache region, ornullto indicate that the default region should be used.- 返回:
this, for method chaining- 另请参阅:
Query.getCacheRegion()
-
getTimeout
public Integer getTimeout()
从接口复制的说明:QueryObtain the query timeout in seconds. This value is eventually passed along to the JDBC query viaStatement.setQueryTimeout(int). Zero indicates no timeout.- 指定者:
getTimeout在接口中BasicQueryContract<X>- 指定者:
getTimeout在接口中Query<X>- 返回:
- The timeout in seconds
- 另请参阅:
Statement.getQueryTimeout(),Statement.setQueryTimeout(int)
-
setTimeout
public QueryImplementor setTimeout(int timeout)
从接口复制的说明:QuerySet 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.- 指定者:
setTimeout在接口中BasicQueryContract<X>- 指定者:
setTimeout在接口中Query<X>- 指定者:
setTimeout在接口中Query<X>- 参数:
timeout- the timeout in seconds- 返回:
this, for method chaining- 另请参阅:
Query.getTimeout()
-
getFetchSize
public Integer getFetchSize()
从接口复制的说明:QueryObtain 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 b y 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.- 指定者:
getFetchSize在接口中BasicQueryContract<X>- 指定者:
getFetchSize在接口中Query<X>- 指定者:
getFetchSize在接口中Query<X>- 返回:
- The timeout in seconds
- 另请参阅:
Statement.getFetchSize(),Statement.setFetchSize(int)
-
setLockOptions
public QueryImplementor setLockOptions(LockOptions lockOptions)
从接口复制的说明:QuerySet the lock options for the query. Specifically only the following are taken into consideration: For alias-specific locking, useQuery.setLockMode(String, LockMode).- 指定者:
setLockOptions在接口中Query<X>- 指定者:
setLockOptions在接口中Query<X>- 参数:
lockOptions- The lock options to apply to the query.- 返回:
this, for method chaining- 另请参阅:
Query.getLockOptions()
-
setLockMode
public QueryImplementor setLockMode(String alias, LockMode lockMode)
从接口复制的说明:QuerySet the LockMode to use for specific alias (as defined in the query's FROM clause). The alias-specific lock modes specified here are added to the query's internalLockOptions. The effect of these alias-specific LockModes is somewhat dependent on the driver/database in use. Generally speaking, for maximum portability, this method should only be used to mark that the rows corresponding to the given alias should be included in pessimistic locking (LockMode.PESSIMISTIC_WRITE).- 指定者:
setLockMode在接口中Query<X>- 指定者:
setLockMode在接口中Query<X>- 参数:
alias- a query alias, or"this"for a collection filterlockMode- The lock mode to apply.- 返回:
this, for method chaining- 另请参阅:
Query.getLockOptions()
-
getComment
public String getComment()
从接口复制的说明:QueryObtain the comment currently associated with this query. Provided SQL commenting is enabled (generally by enabling thehibernate.use_sql_commentsconfig setting), this comment will also be added to the SQL query sent to the database. Often useful for identifying the source of troublesome queries on the database side.- 指定者:
getComment在接口中Query<X>- 指定者:
getComment在接口中Query<X>- 返回:
- The comment.
-
setComment
public QueryImplementor setComment(String comment)
从接口复制的说明:QuerySet the comment for this query.- 指定者:
setComment在接口中Query<X>- 指定者:
setComment在接口中Query<X>- 参数:
comment- The human-readable comment- 返回:
this, for method chaining- 另请参阅:
Query.getComment()
-
addQueryHint
public QueryImplementor addQueryHint(String hint)
从接口复制的说明:QueryAdd a DB query hint to the SQL. These differ from JPA'sQueryHint, which is specific to the JPA implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the vendor-specific hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will determine concatenation and placement.- 指定者:
addQueryHint在接口中Query<X>- 指定者:
addQueryHint在接口中Query<X>- 参数:
hint- The database specific query hint to add.
-
iterate
public Iterator<X> iterate()
从接口复制的说明:QueryReturn the query results as an Iterator. If the query contains multiple results per row, the results are returned in an instance of Object[].
Entities returned as results are initialized on demand. The first SQL query returns identifiers only.
-
scroll
public ScrollableResults scroll()
从接口复制的说明:QueryReturn the query results as ScrollableResults. The scrollability of the returned results depends upon JDBC driver support for scrollable ResultSets.You should call
ScrollableResults.close()after processing the ScrollableResults so that the underlying resources are deallocated right away.
-
scroll
public ScrollableResults scroll(ScrollMode scrollMode)
从接口复制的说明:QueryReturn the query results as ScrollableResults. The scrollability of the returned results depends upon JDBC driver support for scrollable ResultSets.You should call
ScrollableResults.close()after processing the ScrollableResults so that the underlying resources are deallocated right away.- 指定者:
scroll在接口中Query<X>- 指定者:
scroll在接口中Query<X>- 参数:
scrollMode- The scroll mode- 返回:
- the result iterator
- 另请参阅:
ScrollableResults,ScrollMode
-
setFetchSize
public QueryImplementor setFetchSize(int fetchSize)
从接口复制的说明:QuerySets a JDBC fetch size hint for the query.- 指定者:
setFetchSize在接口中BasicQueryContract<X>- 指定者:
setFetchSize在接口中Query<X>- 指定者:
setFetchSize在接口中Query<X>- 参数:
fetchSize- the fetch size hint- 返回:
this, for method chaining- 另请参阅:
Query.getFetchSize()
-
isReadOnly
public boolean isReadOnly()
从接口复制的说明:QueryShould 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.- 指定者:
isReadOnly在接口中BasicQueryContract<X>- 指定者:
isReadOnly在接口中Query<X>- 返回:
trueif the entities and proxies loaded by the query will be put in read-only mode;falseotherwise (they will be modifiable)- 另请参阅:
Query.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.
-
getLockMode
public javax.persistence.LockModeType getLockMode()
- 指定者:
getLockMode在接口中javax.persistence.Query
-
setLockMode
public QueryImplementor<X> setLockMode(javax.persistence.LockModeType lockModeType)
- 指定者:
setLockMode在接口中javax.persistence.Query- 指定者:
setLockMode在接口中Query<X>- 指定者:
setLockMode在接口中Query<X>- 指定者:
setLockMode在接口中javax.persistence.TypedQuery<X>
-
setReadOnly
public QueryImplementor setReadOnly(boolean readOnly)
从接口复制的说明:QuerySet the read-only/modifiable mode for entities and proxies loaded by this Query. This setting overrides the default setting for the persistence context.- 指定者:
setReadOnly在接口中BasicQueryContract<X>- 指定者:
setReadOnly在接口中Query<X>- 指定者:
setReadOnly在接口中Query<X>- 参数:
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.
-
determineProperBooleanType
public Type determineProperBooleanType(int position, Object value, Type defaultType)
- 指定者:
determineProperBooleanType在接口中Query<X>
-
determineProperBooleanType
public Type determineProperBooleanType(String name, Object value, Type defaultType)
- 指定者:
determineProperBooleanType在接口中Query<X>
-
getReturnAliases
public String[] getReturnAliases()
- 指定者:
getReturnAliases在接口中Query<X>
-
getParameters
public Set<javax.persistence.Parameter<?>> getParameters()
- 指定者:
getParameters在接口中javax.persistence.Query
-
isBound
public boolean isBound(javax.persistence.Parameter<?> param)
- 指定者:
isBound在接口中javax.persistence.Query
-
getParameterValue
public <T> T getParameterValue(javax.persistence.Parameter<T> param)
- 指定者:
getParameterValue在接口中javax.persistence.Query
-
setParameter
public <T> QueryImplementor<X> setParameter(javax.persistence.Parameter<T> param, T t)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>
-
setParameter
public QueryImplementor<X> setParameter(javax.persistence.Parameter<Calendar> param, Calendar calendar, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>
-
setParameter
public QueryImplementor<X> setParameter(javax.persistence.Parameter<Date> param, Date date, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>
-
unwrap
public <T> T unwrap(Class<T> cls)
- 指定者:
unwrap在接口中javax.persistence.Query
-
getParameterValue
public Object getParameterValue(String name)
- 指定者:
getParameterValue在接口中javax.persistence.Query
-
getParameter
public javax.persistence.Parameter<?> getParameter(String name)
- 指定者:
getParameter在接口中javax.persistence.Query
-
getParameter
public <T> javax.persistence.Parameter<T> getParameter(String name, Class<T> type)
- 指定者:
getParameter在接口中javax.persistence.Query
-
setParameter
public QueryImplementor<X> setParameter(String name, Object value)
从接口复制的说明:QueryBind a named query parameter using its inferred Type. If the parameter is defined in such a way that the Type cannot be inferred from its usage context then use of this form of binding is not allowed, andQuery.setParameter(String, Object, Type)should be used instead- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>- 参数:
name- the parameter namevalue- the (possibly-null) parameter value- 返回:
this, for method chaining
-
setParameter
public QueryImplementor<X> setParameter(String name, Calendar calendar, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>
-
setParameter
public QueryImplementor<X> setParameter(String name, Date date, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>
-
setEntity
public QueryImplementor<X> setEntity(String name, Object val)
从接口复制的说明:QueryBind an instance of a mapped persistent class to a named query parameter. UseQuery.setParameter(String, Object)for null values.
-
setParameter
public QueryImplementor<X> setParameter(String name, Object val, Type type)
从接口复制的说明:QueryBind a named query parameter using the supplied Type- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 参数:
name- the name of the parameterval- the possibly-null parameter valuetype- the Hibernate type- 返回:
this, for method chaining
-
setParameter
public <T> QueryImplementor<X> setParameter(QueryParameter<T> parameter, T val)
从接口复制的说明:QueryBind a query parameter using its inferred Type. If the parameter is defined in such a way that the Type cannot be inferred from its usage context then use of this form of binding is not allowed, andQuery.setParameter(QueryParameter, Object, Type)should be used instead- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 参数:
parameter- The query parameter mementoval- the possibly-null parameter value- 返回:
this, for method chaining
-
setParameter
public <P> QueryImplementor<X> setParameter(QueryParameter<P> parameter, P val, javax.persistence.TemporalType temporalType)
从接口复制的说明:QueryBind a query parameter as some form of date/time using the indicated temporal-type.- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 参数:
parameter- The query parameter mementoval- the possibly-null parameter valuetemporalType- the temporal-type to use in binding the date/time- 返回:
this, for method chaining
-
setParameter
public <P> QueryImplementor<X> setParameter(String name, P val, javax.persistence.TemporalType temporalType)
从接口复制的说明:QueryBind a named query parameter as some form of date/time using the indicated temporal-type.- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 参数:
name- the parameter nameval- the possibly-null parameter valuetemporalType- the temporal-type to use in binding the date/time- 返回:
this, for method chaining
-
setParameterList
public <P> QueryImplementor<X> setParameterList(QueryParameter<P> parameter, Collection<P> values)
从接口复制的说明:QueryBind multiple values to a query parameter using its inferred Type. The Hibernate type of the parameter values is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the first object in the collection. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).- 指定者:
setParameterList在接口中Query<X>- 指定者:
setParameterList在接口中Query<X>- 参数:
parameter- the parameter mementovalues- a collection of values to list- 返回:
this, for method chaining
-
setParameterList
public QueryImplementor<X> setParameterList(String name, Collection values)
从接口复制的说明:QueryBind multiple values to a named query parameter. The Hibernate type of the parameter is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the first object in the collection. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).- 指定者:
setParameterList在接口中Query<X>- 指定者:
setParameterList在接口中Query<X>- 参数:
name- the name of the parametervalues- a collection of values to list- 返回:
this, for method chaining
-
setParameterList
public Query<X> setParameterList(int position, Collection values)
- 指定者:
setParameterList在接口中Query<X>
-
setParameterList
public QueryImplementor<X> setParameterList(String name, Collection values, Type type)
从接口复制的说明:QueryBind multiple values to a named query parameter. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).- 指定者:
setParameterList在接口中Query<X>- 指定者:
setParameterList在接口中Query<X>- 参数:
name- the name of the parametervalues- a collection of values to listtype- the Hibernate type of the values- 返回:
this, for method chaining
-
setParameterList
public Query<X> setParameterList(int position, Collection values, Type type)
- 指定者:
setParameterList在接口中Query<X>
-
setParameterList
public QueryImplementor<X> setParameterList(String name, Object[] values, Type type)
从接口复制的说明:QueryBind multiple values to a named query parameter. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).- 指定者:
setParameterList在接口中Query<X>- 指定者:
setParameterList在接口中Query<X>- 参数:
name- the name of the parametervalues- a collection of values to listtype- the Hibernate type of the values- 返回:
this, for method chaining
-
setParameterList
public Query<X> setParameterList(int position, Object[] values, Type type)
- 指定者:
setParameterList在接口中Query<X>
-
setParameterList
public QueryImplementor<X> setParameterList(String name, Object[] values)
从接口复制的说明:QueryBind multiple values to a named query parameter. The Hibernate type of the parameter is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the first object in the array. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).- 指定者:
setParameterList在接口中Query<X>- 指定者:
setParameterList在接口中Query<X>- 参数:
name- the name of the parametervalues- a collection of values to list- 返回:
this, for method chaining
-
setParameterList
public Query<X> setParameterList(int position, Object[] values)
- 指定者:
setParameterList在接口中Query<X>
-
setParameter
public <P> QueryImplementor<X> setParameter(QueryParameter<P> parameter, P value, Type type)
从接口复制的说明:QueryBind a query parameter using the supplied Type- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 参数:
parameter- The query parameter mementovalue- the possibly-null parameter valuetype- the Hibernate type- 返回:
this, for method chaining
-
setParameter
public QueryImplementor<X> setParameter(javax.persistence.Parameter<Instant> param, Instant value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(javax.persistence.Parameter<LocalDateTime> param, LocalDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(javax.persistence.Parameter<ZonedDateTime> param, ZonedDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(javax.persistence.Parameter<OffsetDateTime> param, OffsetDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(String name, Instant value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(String name, LocalDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(String name, ZonedDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(String name, OffsetDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setResultTransformer
public QueryImplementor<X> setResultTransformer(ResultTransformer transformer)
从接口复制的说明:QuerySet a strategy for handling the query results. This can be used to change "shape" of the query result.- 指定者:
setResultTransformer在接口中Query<X>- 指定者:
setResultTransformer在接口中Query<X>- 参数:
transformer- The transformer to apply- 返回:
- this (for method chaining)
-
setProperties
public QueryImplementor<X> setProperties(Object bean)
从接口复制的说明:QueryBind the property values of the given bean to named parameters of the query, matching property names with parameter names and mapping property types to Hibernate types using heuristics.- 指定者:
setProperties在接口中Query<X>- 指定者:
setProperties在接口中Query<X>- 参数:
bean- any JavaBean or POJO- 返回:
this, for method chaining
-
setProperties
public QueryImplementor setProperties(Map map)
从接口复制的说明:QueryBind the values of the given Map for each named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.- 指定者:
setProperties在接口中Query<X>- 指定者:
setProperties在接口中Query<X>- 参数:
map- a java.util.Map- 返回:
this, for method chaining
-
getProducer
public QueryProducerImplementor getProducer()
从接口复制的说明:QueryGet the QueryProducer this Query originates from.- 指定者:
getProducer在接口中Query<X>- 指定者:
getProducer在接口中QueryImplementor<X>
-
setOptionalId
public void setOptionalId(Serializable id)
- 指定者:
setOptionalId在接口中QueryImplementor<X>
-
setOptionalEntityName
public void setOptionalEntityName(String entityName)
- 指定者:
setOptionalEntityName在接口中QueryImplementor<X>
-
setOptionalObject
public void setOptionalObject(Object optionalObject)
- 指定者:
setOptionalObject在接口中QueryImplementor<X>
-
setParameter
public QueryImplementor<X> setParameter(int position, LocalDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(int position, Instant value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(int position, ZonedDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(int position, OffsetDateTime value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中Query<X>
-
setParameter
public QueryImplementor<X> setParameter(int position, Object val, Type type)
从接口复制的说明:QueryBind a value to a JDBC-style query parameter.- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 参数:
position- the position of the parameter in the query string, numbered from 0.val- the possibly-null parameter valuetype- the Hibernate type- 返回:
this, for method chaining
-
setEntity
public QueryImplementor<X> setEntity(int position, Object val)
从接口复制的说明:QueryBind an instance of a mapped persistent class to a JDBC-style query parameter. UseQuery.setParameter(int, Object)for null values.
-
setParameter
public <P> QueryImplementor<X> setParameter(int position, P val, javax.persistence.TemporalType temporalType)
从接口复制的说明:QueryBind a positional query parameter as some form of date/time using the indicated temporal-type.- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 参数:
position- the position of the parameter in the query string, numbered from 0.val- the possibly-null parameter valuetemporalType- the temporal-type to use in binding the date/time- 返回:
this, for method chaining
-
executeUpdate
public int executeUpdate()
- 指定者:
executeUpdate在接口中javax.persistence.Query
-
setParameter
public QueryImplementor<X> setParameter(int i, Object o)
从接口复制的说明:QueryBind a positional query parameter using its inferred Type. If the parameter is defined in such a way that the Type cannot be inferred from its usage context then use of this form of binding is not allowed, andQuery.setParameter(int, Object, Type)should be used instead- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>- 参数:
i- the position of the parameter in the query string, numbered from 0.o- the possibly-null parameter value- 返回:
this, for method chaining
-
setParameter
public QueryImplementor<X> setParameter(int i, Calendar calendar, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>
-
setParameter
public QueryImplementor<X> setParameter(int i, Date date, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中Query<X>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<X>
-
getParameterValue
public Object getParameterValue(int position)
- 指定者:
getParameterValue在接口中javax.persistence.Query
-
getParameter
public javax.persistence.Parameter<?> getParameter(int position)
- 指定者:
getParameter在接口中javax.persistence.Query
-
getParameter
public <T> javax.persistence.Parameter<T> getParameter(int position, Class<T> type)- 指定者:
getParameter在接口中javax.persistence.Query
-
-