接口 Query<R>
-
- 所有超级接口:
BasicQueryContract<CommonQueryContract>,CommonQueryContract,javax.persistence.Query,Query<R>,javax.persistence.TypedQuery<R>
- 所有已知子接口:
NativeQuery<T>,NativeQueryImplementor<T>,ProcedureCallImplementor<R>,QueryImplementor<R>
- 所有已知实现类:
AbstractProducedQuery,CollectionFilterImpl,CriteriaQueryTypeQueryAdapter,NativeQueryImpl,ProcedureCallImpl,QueryImpl
public interface Query<R> extends javax.persistence.TypedQuery<R>, Query<R>, CommonQueryContract
Represents an HQL/JPQL query or a compiled Criteria query. Also acts as the Hibernate extension to the JPA Query/TypedQuery contract NOTE:Queryis deprecated, and slated for removal in 6.0. For the time being we leave all methods defined onQueryrather than here because it was previously the public API so we want to leave that unchanged in 5.x. For 6.0 we will move those methods here and then delete that class.- 作者:
- Steve Ebersole, Gavin King
-
-
方法概要
所有方法 实例方法 抽象方法 默认方法 已过时的方法 修饰符和类型 方法 说明 Query<R>addQueryHint(String hint)Add a DB query hint to the SQL.default Query<R>applyFetchGraph(RootGraph graph)Apply the given graph using fetch semanticsQuery<R>applyGraph(RootGraph graph, GraphSemantic semantic)Apply the given graph using the given semanticdefault Query<R>applyLoadGraph(RootGraph graph)Apply the given graph using load semanticsCacheModegetCacheMode()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.FlushModegetHibernateFlushMode()Obtain the FlushMode in effect for this query.LockOptionsgetLockOptions()Obtains the LockOptions in effect for this query.ParameterMetadatagetParameterMetadata()Access to information about query parameters.QueryProducergetProducer()Get the QueryProducer this Query originates from.StringgetQueryString()Get the query string.default List<R>getResultList()default Stream<R>getResultStream()default RgetSingleResult()List<R>list()Return the query results as a List.ScrollableResultsscroll()Return the query results as ScrollableResults.ScrollableResultsscroll(ScrollMode scrollMode)Return the query results as ScrollableResults.default Query<R>setBigDecimal(int position, BigDecimal val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setBigDecimal(String name, BigDecimal val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setBigInteger(int position, BigInteger val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setBigInteger(String name, BigInteger val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setBinary(int position, byte[] val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setBinary(String name, byte[] val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setBoolean(int position, boolean val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setBoolean(String name, boolean val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setByte(int position, byte val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setByte(String name, byte val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setCacheable(boolean cacheable)Enable/disable second level query (result) caching for this query.Query<R>setCacheMode(CacheMode cacheMode)(Re)set the current CacheMode in effect for this query.Query<R>setCacheRegion(String cacheRegion)Set the name of the cache region where query results should be cached (if cached at all).default Query<R>setCalendar(int position, Calendar val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setCalendar(String name, Calendar value)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setCalendarDate(int position, Calendar val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setCalendarDate(String name, Calendar value)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setCharacter(int position, char val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setCharacter(String name, char val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setComment(String comment)Set the comment for this query.default Query<R>setDate(int position, Date val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setDate(String name, Date val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setDouble(int position, double val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setDouble(String name, double val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setEntity(int position, Object val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setEntity(String name, Object val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setFetchSize(int fetchSize)Sets a JDBC fetch size hint for the query.Query<R>setFirstResult(int startPosition)default Query<R>setFloat(int position, float val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setFloat(String name, float val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setFlushMode(javax.persistence.FlushModeType flushMode)default Query<R>setFlushMode(FlushMode flushMode)已过时。(since 5.2) usesetHibernateFlushMode(org.hibernate.FlushMode)insteadQuery<R>setHibernateFlushMode(FlushMode flushMode)(Re)set the current FlushMode in effect for this query.Query<R>setHint(String hintName, Object value)default Query<R>setInteger(int position, int val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setInteger(String name, int val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setLocale(int position, Locale val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setLocale(String name, Locale val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setLockMode(String alias, LockMode lockMode)Set the LockMode to use for specific alias (as defined in the query's FROM clause).Query<R>setLockMode(javax.persistence.LockModeType lockMode)Query<R>setLockOptions(LockOptions lockOptions)Set the lock options for the query.default Query<R>setLong(int position, long val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setLong(String name, long val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setMaxResults(int maxResult)Query<R>setParameter(int position, Object value)Bind a positional query parameter using its inferred Type.Query<R>setParameter(int position, Object val, Type type)Bind a value to a JDBC-style query parameter.Query<R>setParameter(int position, Instant value, javax.persistence.TemporalType temporalType)Query<R>setParameter(int position, LocalDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(int position, OffsetDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(int position, ZonedDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(int position, Calendar value, javax.persistence.TemporalType temporalType)Query<R>setParameter(int position, Date value, javax.persistence.TemporalType temporalType)<P> Query<R>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.Query<R>setParameter(String name, Object value)Bind a named query parameter using its inferred Type.Query<R>setParameter(String name, Object val, Type type)Bind a named query parameter using the supplied TypeQuery<R>setParameter(String name, Instant value, javax.persistence.TemporalType temporalType)Query<R>setParameter(String name, LocalDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(String name, OffsetDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(String name, ZonedDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(String name, Calendar value, javax.persistence.TemporalType temporalType)Query<R>setParameter(String name, Date value, javax.persistence.TemporalType temporalType)<P> Query<R>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.Query<R>setParameter(javax.persistence.Parameter<Instant> param, Instant value, javax.persistence.TemporalType temporalType)Query<R>setParameter(javax.persistence.Parameter<LocalDateTime> param, LocalDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(javax.persistence.Parameter<OffsetDateTime> param, OffsetDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(javax.persistence.Parameter<ZonedDateTime> param, ZonedDateTime value, javax.persistence.TemporalType temporalType)Query<R>setParameter(javax.persistence.Parameter<Calendar> param, Calendar value, javax.persistence.TemporalType temporalType)Query<R>setParameter(javax.persistence.Parameter<Date> param, Date value, javax.persistence.TemporalType temporalType)<T> Query<R>setParameter(javax.persistence.Parameter<T> param, T value)<P> Query<R>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> Query<R>setParameter(QueryParameter<P> parameter, P val, Type type)Bind a query parameter using the supplied Type<T> Query<R>setParameter(QueryParameter<T> parameter, T val)Bind a query parameter using its inferred Type.Query<R>setParameterList(String name, Object[] values)Bind multiple values to a named query parameter.Query<R>setParameterList(String name, Object[] values, Type type)Bind multiple values to a named query parameter.Query<R>setParameterList(String name, Collection values)Bind multiple values to a named query parameter.Query<R>setParameterList(String name, Collection values, Type type)Bind multiple values to a named query parameter.<P> Query<R>setParameterList(QueryParameter<P> parameter, Collection<P> values)Bind multiple values to a query parameter using its inferred Type.default Query<R>setParameters(Object[] values, Type[] types)已过时。(since 5.2) Bind values individuallyQuery<R>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.Query<R>setProperties(Map bean)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.Query<R>setReadOnly(boolean readOnly)Set the read-only/modifiable mode for entities and proxies loaded by this Query.Query<R>setResultTransformer(ResultTransformer transformer)已过时。(since 5.2)default Query<R>setSerializable(int position, Serializable val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setSerializable(String name, Serializable val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setShort(int position, short val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setShort(String name, short val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setString(int position, String val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setString(String name, String val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setText(int position, String val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setText(String name, String val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteaddefault Query<R>setTime(int position, Date val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setTime(String name, Date val)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadQuery<R>setTimeout(int timeout)Set the query timeout in seconds.default Query<R>setTimestamp(int position, Date val)已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteaddefault Query<R>setTimestamp(String name, Date value)已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadStream<R>stream()Retrieve a Stream over the query results.RuniqueResult()Convenience method to return a single instance that matches the query, ornullif the query returns no results.Optional<R>uniqueResultOptional()-
从接口继承的方法 javax.persistence.Query
executeUpdate, getFirstResult, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrap
-
从接口继承的方法 org.hibernate.Query
determineProperBooleanType, determineProperBooleanType, getFlushMode, getHibernateFirstResult, getHibernateMaxResults, getNamedParameters, getQueryOptions, getReturnAliases, getReturnTypes, getTimeout, isCacheable, isReadOnly, iterate, setHibernateFirstResult, setHibernateMaxResults, setParameterList, setParameterList, setParameterList, setParameterList
-
-
-
-
方法详细资料
-
getProducer
QueryProducer getProducer()
Get the QueryProducer this Query originates from.
-
stream
Stream<R> stream()
Retrieve 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.- 返回:
- The results Stream
- 从以下版本开始:
- 5.2
-
applyGraph
Query<R> applyGraph(RootGraph graph, GraphSemantic semantic)
Apply the given graph using the given semantic- 参数:
graph- The graph the apply.semantic- The semantic to use when applying the graph- 返回:
- this - for method chaining
-
applyFetchGraph
default Query<R> applyFetchGraph(RootGraph graph)
Apply the given graph using fetch semantics
-
applyLoadGraph
default Query<R> applyLoadGraph(RootGraph graph)
Apply the given graph using load semantics
-
setParameter
Query<R> setParameter(javax.persistence.Parameter<Instant> param, Instant value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(javax.persistence.Parameter<LocalDateTime> param, LocalDateTime value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(javax.persistence.Parameter<ZonedDateTime> param, ZonedDateTime value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(javax.persistence.Parameter<OffsetDateTime> param, OffsetDateTime value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(String name, Instant value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(String name, LocalDateTime value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(String name, ZonedDateTime value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(String name, OffsetDateTime value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(int position, Instant value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(int position, LocalDateTime value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(int position, ZonedDateTime value, javax.persistence.TemporalType temporalType)
-
setParameter
Query<R> setParameter(int position, OffsetDateTime value, javax.persistence.TemporalType temporalType)
-
scroll
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在接口中Query<R>- 返回:
- the result iterator
- 另请参阅:
ScrollableResults
-
scroll
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<R>- 参数:
scrollMode- The scroll mode- 返回:
- the result iterator
- 另请参阅:
ScrollableResults,ScrollMode
-
list
List<R> 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[].
-
getResultList
default List<R> getResultList()
- 指定者:
getResultList在接口中javax.persistence.Query- 指定者:
getResultList在接口中javax.persistence.TypedQuery<R>
-
uniqueResult
R uniqueResult()
从接口复制的说明:QueryConvenience method to return a single instance that matches the query, ornullif the query returns no results.- 指定者:
uniqueResult在接口中Query<R>- 返回:
- the single result or null
-
getSingleResult
default R getSingleResult()
- 指定者:
getSingleResult在接口中javax.persistence.Query- 指定者:
getSingleResult在接口中javax.persistence.TypedQuery<R>
-
getHibernateFlushMode
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<R>- 指定者:
getHibernateFlushMode在接口中Query<R>- 返回:
- The query FlushMode.
- 另请参阅:
FlushMode
-
getCacheMode
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<R>- 指定者:
getCacheMode在接口中Query<R>- 返回:
- The query CacheMode.
- 另请参阅:
Session.getCacheMode(),CacheMode
-
getCacheRegion
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<R>- 指定者:
getCacheRegion在接口中Query<R>- 返回:
- The specified cache region name into which query results should be placed;
nullindicates the default region.
-
getFetchSize
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<R>- 指定者:
getFetchSize在接口中Query<R>- 返回:
- The timeout in seconds
- 另请参阅:
Statement.getFetchSize(),Statement.setFetchSize(int)
-
getLockOptions
LockOptions getLockOptions()
从接口复制的说明:QueryObtains the LockOptions in effect for this query.- 指定者:
getLockOptions在接口中Query<R>- 返回:
- The LockOptions
- 另请参阅:
LockOptions
-
getComment
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<R>- 返回:
- The comment.
-
getQueryString
String getQueryString()
从接口复制的说明:QueryGet the query string.- 指定者:
getQueryString在接口中Query<R>- 返回:
- the query string
-
getParameterMetadata
ParameterMetadata getParameterMetadata()
从接口复制的说明:QueryAccess to information about query parameters.- 指定者:
getParameterMetadata在接口中Query<R>- 返回:
- information about query parameters.
-
setMaxResults
Query<R> setMaxResults(int maxResult)
- 指定者:
setMaxResults在接口中javax.persistence.Query- 指定者:
setMaxResults在接口中Query<R>- 指定者:
setMaxResults在接口中javax.persistence.TypedQuery<R>
-
setFirstResult
Query<R> setFirstResult(int startPosition)
- 指定者:
setFirstResult在接口中javax.persistence.Query- 指定者:
setFirstResult在接口中Query<R>- 指定者:
setFirstResult在接口中javax.persistence.TypedQuery<R>
-
setParameter
<T> Query<R> setParameter(javax.persistence.Parameter<T> param, T value)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>
-
setParameter
Query<R> setParameter(javax.persistence.Parameter<Calendar> param, Calendar value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>
-
setParameter
Query<R> setParameter(javax.persistence.Parameter<Date> param, Date value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>
-
setParameter
Query<R> 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<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>- 参数:
name- the parameter namevalue- the (possibly-null) parameter value- 返回:
this, for method chaining
-
setParameter
Query<R> setParameter(String name, Object val, Type type)
从接口复制的说明:QueryBind a named query parameter using the supplied Type- 指定者:
setParameter在接口中Query<R>- 参数:
name- the name of the parameterval- the possibly-null parameter valuetype- the Hibernate type- 返回:
this, for method chaining
-
setParameter
Query<R> setParameter(String name, Calendar value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>
-
setParameter
Query<R> setParameter(String name, Date value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>
-
setParameter
Query<R> setParameter(int position, Object value)
从接口复制的说明: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<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>- 参数:
position- the position of the parameter in the query string, numbered from 0.value- the possibly-null parameter value- 返回:
this, for method chaining
-
setParameter
Query<R> setParameter(int position, Calendar value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>
-
setParameter
Query<R> setParameter(int position, Date value, javax.persistence.TemporalType temporalType)
- 指定者:
setParameter在接口中javax.persistence.Query- 指定者:
setParameter在接口中Query<R>- 指定者:
setParameter在接口中javax.persistence.TypedQuery<R>
-
setParameter
<T> Query<R> 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<R>- 参数:
parameter- The query parameter mementoval- the possibly-null parameter value- 返回:
this, for method chaining
-
setParameter
<P> Query<R> 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<R>- 参数:
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
-
setParameter
<P> Query<R> setParameter(QueryParameter<P> parameter, P val, Type type)
从接口复制的说明:QueryBind a query parameter using the supplied Type- 指定者:
setParameter在接口中Query<R>- 参数:
parameter- The query parameter mementoval- the possibly-null parameter valuetype- the Hibernate type- 返回:
this, for method chaining
-
setParameter
Query<R> setParameter(int position, Object val, Type type)
从接口复制的说明:QueryBind a value to a JDBC-style query parameter.- 指定者:
setParameter在接口中Query<R>- 参数:
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
-
setParameter
<P> Query<R> 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<R>- 参数:
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
<P> Query<R> 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<R>- 参数:
name- the parameter nameval- the possibly-null parameter valuetemporalType- the temporal-type to use in binding the date/time- 返回:
this, for method chaining
-
setFlushMode
Query<R> setFlushMode(javax.persistence.FlushModeType flushMode)
- 指定者:
setFlushMode在接口中javax.persistence.Query- 指定者:
setFlushMode在接口中Query<R>- 指定者:
setFlushMode在接口中javax.persistence.TypedQuery<R>
-
setLockMode
Query<R> setLockMode(javax.persistence.LockModeType lockMode)
- 指定者:
setLockMode在接口中javax.persistence.Query- 指定者:
setLockMode在接口中Query<R>- 指定者:
setLockMode在接口中javax.persistence.TypedQuery<R>
-
setReadOnly
Query<R> 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<R>- 指定者:
setReadOnly在接口中Query<R>- 参数:
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.
-
setHibernateFlushMode
Query<R> setHibernateFlushMode(FlushMode flushMode)
从接口复制的说明:Query(Re)set the current FlushMode in effect for this query.- 指定者:
setHibernateFlushMode在接口中BasicQueryContract<R>- 指定者:
setHibernateFlushMode在接口中Query<R>- 参数:
flushMode- The new FlushMode to use.- 返回:
this, for method chaining- 另请参阅:
Query.getHibernateFlushMode()
-
setCacheMode
Query<R> setCacheMode(CacheMode cacheMode)
从接口复制的说明:Query(Re)set the current CacheMode in effect for this query.- 指定者:
setCacheMode在接口中BasicQueryContract<R>- 指定者:
setCacheMode在接口中Query<R>- 参数:
cacheMode- The new CacheMode to use.- 返回:
this, for method chaining- 另请参阅:
Query.getCacheMode()
-
setCacheable
Query<R> setCacheable(boolean cacheable)
从接口复制的说明:QueryEnable/disable second level query (result) caching for this query.- 指定者:
setCacheable在接口中BasicQueryContract<R>- 指定者:
setCacheable在接口中Query<R>- 参数:
cacheable- Should the query results be cacheable?- 返回:
this, for method chaining- 另请参阅:
Query.isCacheable()
-
setCacheRegion
Query<R> setCacheRegion(String cacheRegion)
从接口复制的说明:QuerySet the name of the cache region where query results should be cached (if cached at all).- 指定者:
setCacheRegion在接口中BasicQueryContract<R>- 指定者:
setCacheRegion在接口中Query<R>- 参数:
cacheRegion- the name of a query cache region, ornullto indicate that the default region should be used.- 返回:
this, for method chaining- 另请参阅:
Query.getCacheRegion()
-
setTimeout
Query<R> 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<R>- 指定者:
setTimeout在接口中Query<R>- 参数:
timeout- the timeout in seconds- 返回:
this, for method chaining- 另请参阅:
Query.getTimeout()
-
setFetchSize
Query<R> setFetchSize(int fetchSize)
从接口复制的说明:QuerySets a JDBC fetch size hint for the query.- 指定者:
setFetchSize在接口中BasicQueryContract<R>- 指定者:
setFetchSize在接口中Query<R>- 参数:
fetchSize- the fetch size hint- 返回:
this, for method chaining- 另请参阅:
Query.getFetchSize()
-
setLockOptions
Query<R> 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<R>- 参数:
lockOptions- The lock options to apply to the query.- 返回:
this, for method chaining- 另请参阅:
Query.getLockOptions()
-
setLockMode
Query<R> 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<R>- 参数:
alias- a query alias, or"this"for a collection filterlockMode- The lock mode to apply.- 返回:
this, for method chaining- 另请参阅:
Query.getLockOptions()
-
setComment
Query<R> setComment(String comment)
从接口复制的说明:QuerySet the comment for this query.- 指定者:
setComment在接口中Query<R>- 参数:
comment- The human-readable comment- 返回:
this, for method chaining- 另请参阅:
Query.getComment()
-
addQueryHint
Query<R> 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<R>- 参数:
hint- The database specific query hint to add.
-
setParameterList
<P> Query<R> 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<R>- 参数:
parameter- the parameter mementovalues- a collection of values to list- 返回:
this, for method chaining
-
setParameterList
Query<R> 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<R>- 参数:
name- the name of the parametervalues- a collection of values to list- 返回:
this, for method chaining
-
setParameterList
Query<R> 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<R>- 参数:
name- the name of the parametervalues- a collection of values to listtype- the Hibernate type of the values- 返回:
this, for method chaining
-
setParameterList
Query<R> 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<R>- 参数:
name- the name of the parametervalues- a collection of values to listtype- the Hibernate type of the values- 返回:
this, for method chaining
-
setParameterList
Query<R> 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<R>- 参数:
name- the name of the parametervalues- a collection of values to list- 返回:
this, for method chaining
-
setProperties
Query<R> 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<R>- 参数:
bean- any JavaBean or POJO- 返回:
this, for method chaining
-
setProperties
Query<R> setProperties(Map bean)
从接口复制的说明: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<R>- 参数:
bean- a java.util.Map- 返回:
this, for method chaining
-
setFlushMode
@Deprecated default Query<R> setFlushMode(FlushMode flushMode)
已过时。(since 5.2) usesetHibernateFlushMode(org.hibernate.FlushMode)instead(Re)set the current FlushMode in effect for this query.- 指定者:
setFlushMode在接口中BasicQueryContract<R>- 指定者:
setFlushMode在接口中Query<R>- 参数:
flushMode- The new FlushMode to use.- 返回:
this, for method chaining- 另请参阅:
getHibernateFlushMode()
-
setString
@Deprecated default Query<R> setString(int position, String val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional String-valued parameter.
-
setCharacter
@Deprecated default Query<R> setCharacter(int position, char val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional char-valued parameter.- 指定者:
setCharacter在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setBoolean
@Deprecated default Query<R> setBoolean(int position, boolean val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional boolean-valued parameter.- 指定者:
setBoolean在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setByte
@Deprecated default Query<R> setByte(int position, byte val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional byte-valued parameter.
-
setShort
@Deprecated default Query<R> setShort(int position, short val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional short-valued parameter.
-
setInteger
@Deprecated default Query<R> setInteger(int position, int val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional int-valued parameter.- 指定者:
setInteger在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setLong
@Deprecated default Query<R> setLong(int position, long val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional long-valued parameter.
-
setFloat
@Deprecated default Query<R> setFloat(int position, float val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional float-valued parameter.
-
setDouble
@Deprecated default Query<R> setDouble(int position, double val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional double-valued parameter.
-
setBinary
@Deprecated default Query<R> setBinary(int position, byte[] val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional binary-valued parameter.
-
setText
@Deprecated default Query<R> setText(int position, String val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional String-valued parameter using streaming.
-
setSerializable
@Deprecated default Query<R> setSerializable(int position, Serializable val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional binary-valued parameter using serialization.- 指定者:
setSerializable在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setLocale
@Deprecated default Query<R> setLocale(int position, Locale val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional Locale-valued parameter.
-
setBigDecimal
@Deprecated default Query<R> setBigDecimal(int position, BigDecimal val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional BigDecimal-valued parameter.- 指定者:
setBigDecimal在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setBigInteger
@Deprecated default Query<R> setBigInteger(int position, BigInteger val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional BigDecimal-valued parameter.- 指定者:
setBigInteger在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setDate
@Deprecated default Query<R> setDate(int position, Date val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional Date-valued parameter using just the Date portion.
-
setTime
@Deprecated default Query<R> setTime(int position, Date val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional Date-valued parameter using just the Time portion.
-
setTimestamp
@Deprecated default Query<R> setTimestamp(int position, Date val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional Date-valued parameter using the full Timestamp.- 指定者:
setTimestamp在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setCalendar
@Deprecated default Query<R> setCalendar(int position, Calendar val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional Calendar-valued parameter using the full Timestamp portion.- 指定者:
setCalendar在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setCalendarDate
@Deprecated default Query<R> setCalendarDate(int position, Calendar val)
已过时。(since 5.2) usesetParameter(int, Object)orsetParameter(int, Object, Type)insteadBind a positional Calendar-valued parameter using just the Date portion.- 指定者:
setCalendarDate在接口中Query<R>- 参数:
position- The parameter positionval- The bind value- 返回:
this, for method chaining
-
setString
@Deprecated default Query<R> setString(String name, String val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named String-valued parameter.
-
setCharacter
@Deprecated default Query<R> setCharacter(String name, char val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named char-valued parameter.- 指定者:
setCharacter在接口中Query<R>- 参数:
name- The parameter nameval- The bind value- 返回:
this, for method chaining
-
setBoolean
@Deprecated default Query<R> setBoolean(String name, boolean val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named boolean-valued parameter.- 指定者:
setBoolean在接口中Query<R>- 参数:
name- The parameter nameval- The bind value- 返回:
this, for method chaining
-
setByte
@Deprecated default Query<R> setByte(String name, byte val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named byte-valued parameter.
-
setShort
@Deprecated default Query<R> setShort(String name, short val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named short-valued parameter.
-
setInteger
@Deprecated default Query<R> setInteger(String name, int val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named int-valued parameter.- 指定者:
setInteger在接口中Query<R>- 参数:
name- The parameter nameval- The bind value- 返回:
this, for method chaining
-
setLong
@Deprecated default Query<R> setLong(String name, long val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named long-valued parameter.
-
setFloat
@Deprecated default Query<R> setFloat(String name, float val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named float-valued parameter.
-
setDouble
@Deprecated default Query<R> setDouble(String name, double val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named double-valued parameter.
-
setBinary
@Deprecated default Query<R> setBinary(String name, byte[] val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named binary-valued parameter.
-
setText
@Deprecated default Query<R> setText(String name, String val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named String-valued parameter using streaming.
-
setSerializable
@Deprecated default Query<R> setSerializable(String name, Serializable val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named binary-valued parameter using serialization.- 指定者:
setSerializable在接口中Query<R>- 参数:
name- The parameter nameval- The bind value- 返回:
this, for method chaining
-
setLocale
@Deprecated default Query<R> setLocale(String name, Locale val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named Locale-valued parameter.
-
setBigDecimal
@Deprecated default Query<R> setBigDecimal(String name, BigDecimal val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named BigDecimal-valued parameter.- 指定者:
setBigDecimal在接口中Query<R>- 参数:
name- The parameter nameval- The bind value- 返回:
this, for method chaining
-
setBigInteger
@Deprecated default Query<R> setBigInteger(String name, BigInteger val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named BigInteger-valued parameter.- 指定者:
setBigInteger在接口中Query<R>- 参数:
name- The parameter nameval- The bind value- 返回:
this, for method chaining
-
setDate
@Deprecated default Query<R> setDate(String name, Date val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind the val (time is truncated) of a given Date object to a named query parameter.
-
setTime
@Deprecated default Query<R> setTime(String name, Date val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind the time (val is truncated) of a given Date object to a named query parameter.
-
setTimestamp
@Deprecated default Query<R> setTimestamp(String name, Date value)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind the value and the time of a given Date object to a named query parameter.- 指定者:
setTimestamp在接口中Query<R>- 参数:
name- The name of the parametervalue- The value object- 返回:
this, for method chaining
-
setCalendar
@Deprecated default Query<R> setCalendar(String name, Calendar value)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named Calendar-valued parameter using the full Timestamp.- 指定者:
setCalendar在接口中Query<R>- 参数:
name- The parameter namevalue- The bind value- 返回:
this, for method chaining
-
setCalendarDate
@Deprecated default Query<R> setCalendarDate(String name, Calendar value)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind a named Calendar-valued parameter using just the Date portion.- 指定者:
setCalendarDate在接口中Query<R>- 参数:
name- The parameter namevalue- The bind value- 返回:
this, for method chaining
-
setEntity
@Deprecated Query<R> setEntity(int position, Object val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind an instance of a mapped persistent class to a JDBC-style query parameter. UsesetParameter(int, Object)for null values.
-
setEntity
@Deprecated Query<R> setEntity(String name, Object val)
已过时。(since 5.2) usesetParameter(String, Object)orsetParameter(String, Object, Type)insteadBind an instance of a mapped persistent class to a named query parameter. UsesetParameter(String, Object)for null values.
-
setResultTransformer
@Deprecated Query<R> setResultTransformer(ResultTransformer transformer)
已过时。(since 5.2)Set a strategy for handling the query results. This can be used to change "shape" of the query result.- 指定者:
setResultTransformer在接口中Query<R>- 参数:
transformer- The transformer to apply- 返回:
- this (for method chaining)
-
setParameters
@Deprecated default Query<R> setParameters(Object[] values, Type[] types)
已过时。(since 5.2) Bind values individuallyBind values and types to positional parameters. Allows binding more than one at a time; no real performance impact. The number of elements in each array should match. That is, element number-0 in types array corresponds to element-0 in the values array, etc,- 指定者:
setParameters在接口中Query<R>- 参数:
types- The typesvalues- The values- 返回:
this, for method chaining
-
getResultStream
default Stream<R> getResultStream()
JPA 2.2 defines thegetResultStreammethod so to get aStreamfrom the JDBCResultSet. Hibernate 5.2 already defines thestream()method, sogetResultStreamcan delegate to it.- 指定者:
getResultStream在接口中javax.persistence.Query- 指定者:
getResultStream在接口中javax.persistence.TypedQuery<R>- 返回:
- The results Stream
- 从以下版本开始:
- 5.2.11
-
-