Interface Query<R>
-
- Type Parameters:
R
- The result type, for typed queries, orObject
for untyped queries
- All Superinterfaces:
CommonQueryContract
,MutationQuery
,Query
,SelectionQuery<R>
,TypedQuery<R>
- All Known Subinterfaces:
NativeQuery<T>
,NativeQueryImplementor<R>
,ProcedureCallImplementor<R>
,QueryImplementor<R>
,SqmQueryImplementor<R>
- All Known Implementing Classes:
AbstractQuery
,NativeQueryImpl
,ProcedureCallImpl
,QuerySqmImpl
@Incubating public interface Query<R> extends SelectionQuery<R>, MutationQuery, TypedQuery<R>
Within the context of an active session, an instance of this type represents an executable query, either:- a query written in HQL,
- a named query written in HQL or native SQL, or
- a criteria query.
The subtype
NativeQuery
represents a query written in native SQL.This type simply mixes the
TypedQuery
interface defined by JPA withSelectionQuery
andMutationQuery
. Unfortunately, JPA does not distinguish between selection queries and mutation queries, so we lose that distinction here. However, everyQuery
may logically be classified as one or the other.A
Query
may be obtained from theSession
by calling:QueryProducer.createQuery(String, Class)
, passing the HQL as a string,QueryProducer.createQuery(jakarta.persistence.criteria.CriteriaQuery)
, passing a criteria object, orQueryProducer.createNamedQuery(String, Class)
passing the name of a query defined usingNamedQuery
orNamedNativeQuery
.
A
Query
controls how a query is executed, and allows arguments to be bound to its parameters.- Selection queries are usually executed using
getResultList()
orgetSingleResult()
. - The methods
setMaxResults(int)
andsetFirstResult(int)
control limits and pagination. - The various overloads of
setParameter(String, Object)
andsetParameter(int, Object)
allow arguments to be bound to named and ordinal parameters defined by the query.
Note that this interface offers no real advantages over
SelectionQuery
except for compatibility with the JPA-definedTypedQuery
interface.- See Also:
QueryProducer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Query<R>
addQueryHint(String hint)
Add a database query hint to the SQL query.default Query<R>
applyFetchGraph(RootGraph graph)
Apply the given graph using fetch semantics.Query<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 semantics.Query<R>
disableFetchProfile(String profileName)
Disable thefetch profile
with the given name in this session.Query<R>
enableFetchProfile(String profileName)
Enable thefetch profile
for this query.int
executeUpdate()
Execute an insert, update, or delete statement, and return the number of affected entities.String
getComment()
Obtain the comment currently associated with this query.LockOptions
getLockOptions()
Obtains theLockOptions
in effect for this query.ParameterMetadata
getParameterMetadata()
Access to information about query parameters.QueryOptions
getQueryOptions()
Get the execution options for thisQuery
.String
getQueryString()
The query as a string, ornull
in the case of a criteria query.default List<R>
getResultList()
Execute the query and return the query results as aList
.default Stream<R>
getResultStream()
Execute the query and return the query results as aStream
.SharedSessionContract
getSession()
Get theQueryProducer
which produced thisQuery
, that is, theSession
orStatelessSession
that was used to create thisQuery
instance.R
getSingleResult()
Execute the query and return the single result of the query, throwing an exception if the query returns no results.List<R>
list()
Execute the query and return the query results as aList
.ScrollableResults<R>
scroll()
Execute the query and return the results in a scrollable form.ScrollableResults<R>
scroll(ScrollMode scrollMode)
Execute the query and return the results in a scrollable form.Query<R>
setCacheable(boolean cacheable)
Enable/disable second level query (result) caching for this query.Query<R>
setCacheMode(CacheMode cacheMode)
Set the currentCacheMode
in effect for this query.Query<R>
setCacheRegion(String cacheRegion)
Set the name of the cache region where query results should be cached (assumingSelectionQuery.isCacheable()
).Query<R>
setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode)
Query<R>
setCacheStoreMode(CacheStoreMode cacheStoreMode)
Query<R>
setComment(String comment)
Set the comment for this query.Query<R>
setEntityGraph(EntityGraph<R> graph, GraphSemantic semantic)
Apply anEntityGraph
to the query.Query<R>
setFetchSize(int fetchSize)
Sets a JDBC fetch size hint for the query.Query<R>
setFirstResult(int startPosition)
Set the first row position to return from the query results.Query<R>
setFlushMode(FlushModeType flushMode)
Set theFlushMode
in to use for this query.Query<R>
setHibernateFlushMode(FlushMode flushMode)
Set the currentFlushMode
in effect for this query.Query<R>
setHint(String hintName, Object value)
Set a hint.Query<R>
setLockMode(LockModeType lockMode)
Specify the rootLockModeType
for the queryQuery<R>
setLockMode(String alias, LockMode lockMode)
Set theLockMode
to use for particular alias defined in theFROM
clause of the query.Query<R>
setLockOptions(LockOptions lockOptions)
Apply the given lock options to this query.Query<R>
setMaxResults(int maxResult)
Set the max number of rows requested for the query results.Query<R>
setOrder(List<Order<? super R>> orderList)
If the result type of this query is an entity class, add one or more rules for ordering the query results.Query<R>
setOrder(Order<? super R> order)
If the result type of this query is an entity class, add a rule for ordering the query results.default Query<R>
setPage(Page page)
Set the page of results to return.Query<R>
setParameter(int parameter, Object argument)
Bind the given argument to an ordinal query parameter.Query<R>
setParameter(int parameter, Instant argument, TemporalType temporalType)
Bind anInstant
value to the ordinal query parameter using just the portion indicated by the givenTemporalType
.Query<R>
setParameter(int parameter, Calendar argument, TemporalType temporalType)
Query
overrideQuery<R>
setParameter(int parameter, Date argument, TemporalType temporalType)
Query
override<P> Query<R>
setParameter(int parameter, P argument, Class<P> type)
Bind the given argument to an ordinal query parameter using the given Class reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameter(int parameter, P argument, BindableType<P> type)
Bind the given argument to an ordinal query parameter using the givenBindableType
.Query<R>
setParameter(Parameter<Calendar> parameter, Calendar argument, TemporalType temporalType)
Query
overrideQuery<R>
setParameter(Parameter<Date> parameter, Date argument, TemporalType temporalType)
Query
override<T> Query<R>
setParameter(Parameter<T> parameter, T argument)
Query
overrideQuery<R>
setParameter(String parameter, Object argument)
Bind the given argument to a named query parameter.Query<R>
setParameter(String parameter, Instant argument, TemporalType temporalType)
Bind anInstant
value to the named query parameter using just the portion indicated by the givenTemporalType
.Query<R>
setParameter(String parameter, Calendar argument, TemporalType temporalType)
Query
overrideQuery<R>
setParameter(String parameter, Date argument, TemporalType temporalType)
Query
override<P> Query<R>
setParameter(String parameter, P argument, Class<P> type)
Bind the given argument to a named query parameter using the given Class reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameter(String parameter, P argument, BindableType<P> type)
Bind the given argument to a named query parameter using the givenBindableType
.<P> Query<R>
setParameter(QueryParameter<P> parameter, P argument, Class<P> type)
Bind an argument to the query parameter represented by the givenQueryParameter
using the given Class reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameter(QueryParameter<P> parameter, P argument, BindableType<P> type)
Bind an argument to the query parameter represented by the givenQueryParameter
using the givenBindableType
.<T> Query<R>
setParameter(QueryParameter<T> parameter, T argument)
Bind an argument to the query parameter represented by the givenQueryParameter
.Query<R>
setParameterList(int parameter, Object[] arguments)
Bind multiple arguments to an ordinal query parameter.Query<R>
setParameterList(int parameter, Collection arguments)
Bind multiple arguments to an ordinal query parameter.<P> Query<R>
setParameterList(int parameter, Collection<? extends P> arguments, Class<P> javaType)
Bind multiple arguments to an ordinal query parameter using the given Class reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameterList(int parameter, Collection<? extends P> arguments, BindableType<P> type)
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.<P> Query<R>
setParameterList(int parameter, P[] arguments, Class<P> javaType)
Bind multiple arguments to an ordinal query parameter using the givenClass
reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameterList(int parameter, P[] arguments, BindableType<P> type)
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.Query<R>
setParameterList(String parameter, Object[] values)
Bind multiple arguments to a named query parameter.Query<R>
setParameterList(String parameter, Collection arguments)
Bind multiple arguments to a named query parameter.<P> Query<R>
setParameterList(String parameter, Collection<? extends P> arguments, Class<P> javaType)
Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameterList(String parameter, Collection<? extends P> arguments, BindableType<P> type)
Bind multiple arguments to a named query parameter using the givenBindableType
.<P> Query<R>
setParameterList(String parameter, P[] arguments, Class<P> javaType)
Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameterList(String parameter, P[] arguments, BindableType<P> type)
Bind multiple arguments to a named query parameter using the givenBindableType
.<P> Query<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> arguments)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
.<P> Query<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> arguments, Class<P> javaType)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
using the given Class reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> arguments, BindableType<P> type)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
, inferring theBindableType
.<P> Query<R>
setParameterList(QueryParameter<P> parameter, P[] arguments)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
.<P> Query<R>
setParameterList(QueryParameter<P> parameter, P[] arguments, Class<P> javaType)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
using the givenClass
reference to attempt to determine theBindableType
to use.<P> Query<R>
setParameterList(QueryParameter<P> parameter, P[] arguments, BindableType<P> type)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
, inferring theBindableType
.Query<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 givenMap
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 thisQuery
.Query<R>
setResultListTransformer(ResultListTransformer<R> transformer)
Set aResultListTransformer
.default <T> Query<T>
setResultTransformer(ResultTransformer<T> transformer)
Query<R>
setTimeout(int timeout)
Set the query timeout in seconds.<T> Query<T>
setTupleTransformer(TupleTransformer<T> transformer)
Set aTupleTransformer
.default Stream<R>
stream()
Execute the query and return the query results as aStream
.R
uniqueResult()
Execute the query and return the single result of the query, ornull
if the query returns no results.Optional<R>
uniqueResultOptional()
Execute the query and return the single result of the query as an instance ofOptional
.-
Methods inherited from interface org.hibernate.query.CommonQueryContract
getFlushMode, getHibernateFlushMode, getTimeout
-
Methods inherited from interface jakarta.persistence.Query
getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrap
-
Methods inherited from interface org.hibernate.query.SelectionQuery
getCacheMode, getCacheRegion, getCacheRetrieveMode, getCacheStoreMode, getFetchSize, getFirstResult, getHibernateLockMode, getKeyedResultList, getLockMode, getMaxResults, getResultCount, getSingleResultOrNull, isCacheable, isQueryPlanCacheable, isReadOnly, setAliasSpecificLockMode, setFollowOnLocking, setHibernateLockMode, setQueryPlanCacheable
-
-
-
-
Method Detail
-
list
List<R> list()
Execute the query and return the query results as aList
. If the query contains multiple items in the selection list, then by default each result in the list is packaged in an array of typeObject[]
.- Specified by:
list
in interfaceSelectionQuery<R>
- Returns:
- the result list
-
getResultList
default List<R> getResultList()
Execute the query and return the query results as aList
. If the query contains multiple items in the selection list, then by default each result in the list is packaged in an array of typeObject[]
.- Specified by:
getResultList
in interfaceQuery
- Specified by:
getResultList
in interfaceSelectionQuery<R>
- Specified by:
getResultList
in interfaceTypedQuery<R>
- Returns:
- the results as a list
- Implementation Note:
- Delegates to
list()
-
scroll
ScrollableResults<R> scroll()
Execute the query and return the results in a scrollable form.This overload simply calls
scroll(ScrollMode)
using the dialect default scroll mode.- Specified by:
scroll
in interfaceSelectionQuery<R>
- API Note:
- The exact behavior of this method depends somewhat
on the level of JDBC driver support for scrollable
ResultSet
s, and so is not very portable between database.
-
scroll
ScrollableResults<R> scroll(ScrollMode scrollMode)
Execute the query and return the results in a scrollable form. The capabilities of the returnedScrollableResults
depend on the specifiedScrollMode
.- Specified by:
scroll
in interfaceSelectionQuery<R>
- API Note:
- The exact behavior of this method depends somewhat
on the level of JDBC driver support for scrollable
ResultSet
s, and so is not very portable between database.
-
getResultStream
default Stream<R> getResultStream()
Execute the query and return the query results as aStream
. If the query contains multiple items in the selection list, then by default each result in the stream is packaged in an array of typeObject[]
.The client should call
BaseStream.close()
after processing the stream so that resources are freed as soon as possible.- Specified by:
getResultStream
in interfaceQuery
- Specified by:
getResultStream
in interfaceSelectionQuery<R>
- Specified by:
getResultStream
in interfaceTypedQuery<R>
- Returns:
- The results as a
Stream
- Implementation Note:
- Delegates to
stream()
, which in turn delegates to this method. Implementors should implement at least one of these methods.
-
stream
default Stream<R> stream()
Execute the query and return the query results as aStream
. If the query contains multiple items in the selection list, then by default each result in the stream is packaged in an array of typeObject[]
.The client should call
BaseStream.close()
after processing the stream so that resources are freed as soon as possible.- Specified by:
stream
in interfaceSelectionQuery<R>
- Returns:
- The results as a
Stream
- Since:
- 5.2
-
uniqueResult
R uniqueResult()
Execute the query and return the single result of the query, ornull
if the query returns no results.- Specified by:
uniqueResult
in interfaceSelectionQuery<R>
- Returns:
- the single result or
null
if there is no result to return - Throws:
NonUniqueResultException
- if there is more than one matching result
-
getSingleResult
R getSingleResult()
Execute the query and return the single result of the query, throwing an exception if the query returns no results.- Specified by:
getSingleResult
in interfaceQuery
- Specified by:
getSingleResult
in interfaceSelectionQuery<R>
- Specified by:
getSingleResult
in interfaceTypedQuery<R>
- Returns:
- the single result, only if there is exactly one
- Throws:
NonUniqueResultException
- if there is more than one matching resultNoResultException
- if there is no result to return
-
uniqueResultOptional
Optional<R> uniqueResultOptional()
Execute the query and return the single result of the query as an instance ofOptional
.- Specified by:
uniqueResultOptional
in interfaceSelectionQuery<R>
- Returns:
- the single result as an
Optional
- Throws:
NonUniqueResultException
- if there is more than one matching result
-
executeUpdate
int executeUpdate()
Execute an insert, update, or delete statement, and return the number of affected entities.For use with instances of
MutationQuery
created usingQueryProducer.createMutationQuery(String)
,QueryProducer.createNamedMutationQuery(String)
,QueryProducer.createNativeMutationQuery(String)
,QueryProducer.createQuery(jakarta.persistence.criteria.CriteriaUpdate)
, orQueryProducer.createQuery(jakarta.persistence.criteria.CriteriaDelete)
.- Specified by:
executeUpdate
in interfaceMutationQuery
- Specified by:
executeUpdate
in interfaceQuery
- Returns:
- the number of affected entity instances (may differ from the number of affected rows)
- See Also:
QueryProducer.createMutationQuery(java.lang.String)
,QueryProducer.createMutationQuery(String)
,QueryProducer.createNamedMutationQuery(String)
,QueryProducer.createNativeMutationQuery(String)
,Query.executeUpdate()
,QueryProducer.createMutationQuery(java.lang.String)
- API Note:
- This method is needed because this interface extends
Query
, which defines this method. SeeMutationQuery
andSelectionQuery
.
-
getSession
SharedSessionContract getSession()
Get theQueryProducer
which produced thisQuery
, that is, theSession
orStatelessSession
that was used to create thisQuery
instance.- Returns:
- The producer of this query
-
getQueryString
String getQueryString()
The query as a string, ornull
in the case of a criteria query.
-
applyGraph
Query<R> applyGraph(RootGraph graph, GraphSemantic semantic)
Apply the given graph using the given semantic- Parameters:
graph
- The graph to apply.semantic
- The semantic to use when applying the graph
-
applyFetchGraph
default Query<R> applyFetchGraph(RootGraph graph)
Apply the given graph using fetch semantics.- API Note:
- This method calls
applyGraph(RootGraph, GraphSemantic)
usingGraphSemantic.FETCH
as the semantic.
-
applyLoadGraph
default Query<R> applyLoadGraph(RootGraph graph)
Apply the given graph using load semantics.- API Note:
- This method calls
applyGraph(RootGraph, GraphSemantic)
usingGraphSemantic.LOAD
as the semantic.
-
getComment
String getComment()
Obtain the comment currently associated with this query.If SQL commenting is enabled, the comment will be added to the SQL query sent to the database, which may be useful for identifying the source of troublesome queries.
SQL commenting may be enabled using the configuration property "hibernate.use_sql_comments".
- Specified by:
getComment
in interfaceCommonQueryContract
- Returns:
- The comment.
-
setComment
Query<R> setComment(String comment)
Set the comment for this query.If SQL commenting is enabled, the comment will be added to the SQL query sent to the database, which may be useful for identifying the source of troublesome queries.
SQL commenting may be enabled using the configuration property "hibernate.use_sql_comments".
- Specified by:
setComment
in interfaceCommonQueryContract
- Specified by:
setComment
in interfaceMutationQuery
- Specified by:
setComment
in interfaceSelectionQuery<R>
- Parameters:
comment
- The human-readable comment- Returns:
this
, for method chaining- See Also:
getComment()
-
addQueryHint
Query<R> addQueryHint(String hint)
Add a database query hint to the SQL query.A database hint is a completely different concept to a JPA hint specified using
QueryHint
orQuery.getHints()
. These are hints to the JPA provider.Multiple query hints may be specified. The operation
Dialect.getQueryHintString(String, List)
determines how the hint is actually added to the SQL query.- Parameters:
hint
- The database specific query hint to add.
-
getLockOptions
LockOptions getLockOptions()
Obtains theLockOptions
in effect for this query.- Specified by:
getLockOptions
in interfaceSelectionQuery<R>
- Returns:
- The
LockOptions
currently in effect - See Also:
LockOptions
-
setLockOptions
Query<R> setLockOptions(LockOptions lockOptions)
Apply the given lock options to this query. Alias-specific lock modes in the given lock options are merged with any alias-specific lock mode which have already been set. If a lock mode has already been specified for an alias that is among the aliases in the given lock options, the lock mode specified in the given lock options overrides the lock mode that was already set.- Parameters:
lockOptions
- The lock options to apply to the query.- Returns:
this
, for method chaining- See Also:
getLockOptions()
-
setLockMode
Query<R> setLockMode(String alias, LockMode lockMode)
Set theLockMode
to use for particular alias defined in theFROM
clause of the query.The alias-specific lock modes specified here are added to the
LockOption
s.The effect of alias-specific locking is quite dependent on the driver and database. For maximum portability, the given lock mode should be
LockMode.PESSIMISTIC_WRITE
.- Specified by:
setLockMode
in interfaceSelectionQuery<R>
- Parameters:
alias
- A query aliaslockMode
- The lock mode to apply- Returns:
this
, for method chaining- See Also:
getLockOptions()
-
setTupleTransformer
<T> Query<T> setTupleTransformer(TupleTransformer<T> transformer)
Set aTupleTransformer
.
-
setResultListTransformer
Query<R> setResultListTransformer(ResultListTransformer<R> transformer)
Set aResultListTransformer
.
-
getQueryOptions
QueryOptions getQueryOptions()
Get the execution options for thisQuery
. Many of the setters of this object update the state of the returnedQueryOptions
. This is useful because it gives access to s primitive value in its (nullable) wrapper form, rather than the primitive form as required by JPA. This allows us to distinguish whether a value has been explicitly set by the client.- Returns:
- Return the encapsulation of this query's options.
-
getParameterMetadata
ParameterMetadata getParameterMetadata()
Access to information about query parameters.- Returns:
- information about query parameters.
-
setParameter
Query<R> setParameter(String parameter, Object argument)
Bind the given argument to a named query parameter.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms accept a "type".
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
setParameter(String, Object, Class)
,setParameter(String, Object, BindableType)
-
setParameter
<P> Query<R> setParameter(String parameter, P argument, Class<P> type)
Bind the given argument to a named query parameter using the given Class reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameter(String, Object)
is used.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- See Also:
setParameter(String, Object, BindableType)
-
setParameter
<P> Query<R> setParameter(String parameter, P argument, BindableType<P> type)
Bind the given argument to a named query parameter using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
-
setParameter
Query<R> setParameter(String parameter, Instant argument, TemporalType temporalType)
Bind anInstant
value to the named query parameter using just the portion indicated by the givenTemporalType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
-
setParameter
Query<R> setParameter(String parameter, Calendar argument, TemporalType temporalType)
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
Query.setParameter(String, Calendar, TemporalType)
-
setParameter
Query<R> setParameter(String parameter, Date argument, TemporalType temporalType)
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
Query.setParameter(String, Date, TemporalType)
-
setParameter
Query<R> setParameter(int parameter, Object argument)
Bind the given argument to an ordinal query parameter.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms which accepts a "type".
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
setParameter(int, Object, Class)
,setParameter(int, Object, BindableType)
-
setParameter
<P> Query<R> setParameter(int parameter, P argument, Class<P> type)
Bind the given argument to an ordinal query parameter using the given Class reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameter(int, Object)
is used.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- See Also:
setParameter(int, Object, BindableType)
-
setParameter
<P> Query<R> setParameter(int parameter, P argument, BindableType<P> type)
Bind the given argument to an ordinal query parameter using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
-
setParameter
Query<R> setParameter(int parameter, Instant argument, TemporalType temporalType)
Bind anInstant
value to the ordinal query parameter using just the portion indicated by the givenTemporalType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
-
setParameter
Query<R> setParameter(int parameter, Date argument, TemporalType temporalType)
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
Query.setParameter(int, Date, TemporalType)
-
setParameter
Query<R> setParameter(int parameter, Calendar argument, TemporalType temporalType)
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
Query.setParameter(int, Calendar, TemporalType)
-
setParameter
<T> Query<R> setParameter(QueryParameter<T> parameter, T argument)
Bind an argument to the query parameter represented by the givenQueryParameter
.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms which accepts a "type".
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Parameters:
parameter
- the query parameter mementoargument
- the argument, which might be null- Returns:
this
, for method chaining- See Also:
setParameter(QueryParameter, Object, BindableType)
-
setParameter
<P> Query<R> setParameter(QueryParameter<P> parameter, P argument, Class<P> type)
Bind an argument to the query parameter represented by the givenQueryParameter
using the given Class reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameter(QueryParameter, Object)
is used- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Parameters:
parameter
- the query parameter mementoargument
- the argument, which might be nulltype
- aBindableType
representing the type of the parameter- Returns:
this
, for method chaining- See Also:
setParameter(QueryParameter, Object, BindableType)
-
setParameter
<P> Query<R> setParameter(QueryParameter<P> parameter, P argument, BindableType<P> type)
Bind an argument to the query parameter represented by the givenQueryParameter
using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Parameters:
parameter
- the query parameter mementoargument
- the argument, which might be nulltype
- anBindableType
representing the type of the parameter- Returns:
this
, for method chaining
-
setParameter
<T> Query<R> setParameter(Parameter<T> parameter, T argument)
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
Query.setParameter(Parameter, Object)
-
setParameter
Query<R> setParameter(Parameter<Calendar> parameter, Calendar argument, TemporalType temporalType)
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
Query.setParameter(Parameter, Calendar, TemporalType)
-
setParameter
Query<R> setParameter(Parameter<Date> parameter, Date argument, TemporalType temporalType)
Query
override- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceMutationQuery
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceTypedQuery<R>
- See Also:
Query.setParameter(Parameter, Date, TemporalType)
-
setParameterList
Query<R> setParameterList(String parameter, Collection arguments)
Bind multiple arguments to a named query parameter.The "type mapping" for the binding is inferred from the type of the first collection element.
- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
setParameterList(java.lang.String, java.util.Collection, BindableType)
- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(String parameter, Collection<? extends P> arguments, Class<P> javaType)
Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameterList(String, Collection)
is used.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
setParameterList(java.lang.String, java.util.Collection, BindableType)
- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(String parameter, Collection<? extends P> arguments, BindableType<P> type)
Bind multiple arguments to a named query parameter using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
Query<R> setParameterList(String parameter, Object[] values)
Bind multiple arguments to a named query parameter.The "type mapping" for the binding is inferred from the type of the first collection element.
- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(String parameter, P[] arguments, Class<P> javaType)
Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameterList(String, Collection)
is used.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
setParameterList(java.lang.String, Object[], BindableType)
- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(String parameter, P[] arguments, BindableType<P> type)
Bind multiple arguments to a named query parameter using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
Query<R> setParameterList(int parameter, Collection arguments)
Bind multiple arguments to an ordinal query parameter.The "type mapping" for the binding is inferred from the type of the first collection element.
- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(int parameter, Collection<? extends P> arguments, Class<P> javaType)
Bind multiple arguments to an ordinal query parameter using the given Class reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameterList(String, Collection)
is used.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
setParameterList(int, Collection, BindableType)
- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(int parameter, Collection<? extends P> arguments, BindableType<P> type)
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
Query<R> setParameterList(int parameter, Object[] arguments)
Bind multiple arguments to an ordinal query parameter.The "type mapping" for the binding is inferred from the type of the first collection element.
- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(int parameter, P[] arguments, Class<P> javaType)
Bind multiple arguments to an ordinal query parameter using the givenClass
reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameterList(String, Collection)
is used.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
setParameterList(int, Object[], BindableType)
- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(int parameter, P[] arguments, BindableType<P> type)
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> arguments)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
.The type of the parameter is inferred from the context in which it occurs, and from the type of the first given argument.
- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Parameters:
parameter
- the parameter mementoarguments
- a collection of arguments- Returns:
this
, for method chaining
-
setParameterList
<P> Query<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> arguments, Class<P> javaType)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
using the given Class reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameterList(String, Collection)
is used.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
setParameterList(QueryParameter, java.util.Collection, BindableType)
- API Note:
- This is used for binding a list of values to an expression such
as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> arguments, BindableType<P> type)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
, inferring theBindableType
.The "type mapping" for the binding is inferred from the type of the first collection element.
- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression such
as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(QueryParameter<P> parameter, P[] arguments)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
.The type of the parameter is inferred between the context in which it occurs, the type associated with the QueryParameter and the type of the first given argument.
- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Parameters:
parameter
- the parameter mementoarguments
- a collection of arguments- Returns:
this
, for method chaining
-
setParameterList
<P> Query<R> setParameterList(QueryParameter<P> parameter, P[] arguments, Class<P> javaType)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
using the givenClass
reference to attempt to determine theBindableType
to use. If unable to determine an appropriateBindableType
,setParameterList(String, Collection)
is used.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
setParameterList(QueryParameter, Object[], BindableType)
- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setParameterList
<P> Query<R> setParameterList(QueryParameter<P> parameter, P[] arguments, BindableType<P> type)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
, inferring theBindableType
.The "type mapping" for the binding is inferred from the type of the first collection element
- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceMutationQuery
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Returns:
this
, for method chaining- API Note:
- This is used for binding a list of values to an expression
such as
entity.field in (:values)
.
-
setProperties
Query<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.- Specified by:
setProperties
in interfaceCommonQueryContract
- Specified by:
setProperties
in interfaceMutationQuery
- Specified by:
setProperties
in interfaceSelectionQuery<R>
- Parameters:
bean
- any JavaBean or POJO- Returns:
this
, for method chaining
-
setProperties
Query<R> setProperties(Map bean)
Bind the values of the givenMap
for each named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.- Specified by:
setProperties
in interfaceCommonQueryContract
- Specified by:
setProperties
in interfaceMutationQuery
- Specified by:
setProperties
in interfaceSelectionQuery<R>
- Parameters:
bean
- aMap
of names to arguments- Returns:
this
, for method chaining
-
setHibernateFlushMode
Query<R> setHibernateFlushMode(FlushMode flushMode)
Description copied from interface:CommonQueryContract
Set the currentFlushMode
in effect for this query.- Specified by:
setHibernateFlushMode
in interfaceCommonQueryContract
- Specified by:
setHibernateFlushMode
in interfaceMutationQuery
- Specified by:
setHibernateFlushMode
in interfaceSelectionQuery<R>
- See Also:
CommonQueryContract.getHibernateFlushMode()
,Session.getHibernateFlushMode()
-
setCacheable
Query<R> setCacheable(boolean cacheable)
Description copied from interface:SelectionQuery
Enable/disable second level query (result) caching for this query.- Specified by:
setCacheable
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.isCacheable()
-
setCacheRegion
Query<R> setCacheRegion(String cacheRegion)
Description copied from interface:SelectionQuery
Set the name of the cache region where query results should be cached (assumingSelectionQuery.isCacheable()
).null
indicates to use the default region.- Specified by:
setCacheRegion
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.getCacheRegion()
-
setCacheMode
Query<R> setCacheMode(CacheMode cacheMode)
Description copied from interface:SelectionQuery
Set the currentCacheMode
in effect for this query.- Specified by:
setCacheMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.getCacheMode()
,Session.setCacheMode(CacheMode)
-
setCacheStoreMode
Query<R> setCacheStoreMode(CacheStoreMode cacheStoreMode)
- Specified by:
setCacheStoreMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.setCacheMode(CacheMode)
-
setCacheRetrieveMode
Query<R> setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode)
- Specified by:
setCacheRetrieveMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.setCacheMode(CacheMode)
-
setTimeout
Query<R> setTimeout(int timeout)
Description copied from interface:CommonQueryContract
Set the query timeout in seconds.Any value set here is eventually passed directly along to the JDBC statement, which expressly disallows negative values. So negative values should be avoided as a general rule.
A value of zero indicates no timeout.
- Specified by:
setTimeout
in interfaceCommonQueryContract
- Specified by:
setTimeout
in interfaceMutationQuery
- Specified by:
setTimeout
in interfaceSelectionQuery<R>
- Parameters:
timeout
- the timeout in seconds- Returns:
this
, for method chaining- See Also:
CommonQueryContract.getTimeout()
-
setFetchSize
Query<R> setFetchSize(int fetchSize)
Description copied from interface:SelectionQuery
Sets a JDBC fetch size hint for the query.- Specified by:
setFetchSize
in interfaceSelectionQuery<R>
- Parameters:
fetchSize
- the fetch size hint- Returns:
this
, for method chaining- See Also:
SelectionQuery.getFetchSize()
-
setReadOnly
Query<R> setReadOnly(boolean readOnly)
Description copied from interface:SelectionQuery
Set the read-only/modifiable mode for entities and proxies loaded by thisQuery
. This setting overrides the default setting for the persistence context,Session.isDefaultReadOnly()
.To set the default read-only/modifiable setting used for entities and proxies that are loaded into the session, use
Session.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 beforeQuery the query was executed.
- Specified by:
setReadOnly
in interfaceSelectionQuery<R>
- Parameters:
readOnly
-true
indicates that entities and proxies loaded by the query are to be put in read-only mode;false
indicates that entities and proxies loaded by the query will be put in modifiable mode- Returns:
this
, for method chaining
-
setMaxResults
Query<R> setMaxResults(int maxResult)
Description copied from interface:SelectionQuery
Set the max number of rows requested for the query results. Applied to the SQL query- Specified by:
setMaxResults
in interfaceQuery
- Specified by:
setMaxResults
in interfaceSelectionQuery<R>
- Specified by:
setMaxResults
in interfaceTypedQuery<R>
-
setFirstResult
Query<R> setFirstResult(int startPosition)
Description copied from interface:SelectionQuery
Set the first row position to return from the query results. Applied to the SQL query.- Specified by:
setFirstResult
in interfaceQuery
- Specified by:
setFirstResult
in interfaceSelectionQuery<R>
- Specified by:
setFirstResult
in interfaceTypedQuery<R>
-
setPage
@Incubating default Query<R> setPage(Page page)
Description copied from interface:SelectionQuery
Set the page of results to return.- Specified by:
setPage
in interfaceSelectionQuery<R>
- See Also:
Page
-
setHint
Query<R> setHint(String hintName, Object value)
Description copied from interface:CommonQueryContract
Set a hint. The hints understood by Hibernate are enumerated byAvailableHints
.- Specified by:
setHint
in interfaceCommonQueryContract
- Specified by:
setHint
in interfaceMutationQuery
- Specified by:
setHint
in interfaceQuery
- Specified by:
setHint
in interfaceSelectionQuery<R>
- Specified by:
setHint
in interfaceTypedQuery<R>
- See Also:
HibernateHints
,SpecHints
-
setEntityGraph
Query<R> setEntityGraph(EntityGraph<R> graph, GraphSemantic semantic)
Description copied from interface:SelectionQuery
Apply anEntityGraph
to the query.This is an alternative way to specify the associations which should be fetched as part of the initial query.
- Specified by:
setEntityGraph
in interfaceSelectionQuery<R>
-
enableFetchProfile
Query<R> enableFetchProfile(String profileName)
Description copied from interface:SelectionQuery
Enable thefetch profile
for this query. If the requested fetch profile is already enabled, the call has no effect.This is an alternative way to specify the associations which should be fetched as part of the initial query.
- Specified by:
enableFetchProfile
in interfaceSelectionQuery<R>
- Parameters:
profileName
- the name of the fetch profile to be enabled- See Also:
FetchProfile
-
disableFetchProfile
Query<R> disableFetchProfile(String profileName)
Description copied from interface:SelectionQuery
Disable thefetch profile
with the given name in this session. If the requested fetch profile is not currently enabled, the call has no effect.- Specified by:
disableFetchProfile
in interfaceSelectionQuery<R>
- Parameters:
profileName
- the name of the fetch profile to be disabled- See Also:
FetchProfile
-
setFlushMode
Query<R> setFlushMode(FlushModeType flushMode)
Description copied from interface:CommonQueryContract
Set theFlushMode
in to use for this query.- Specified by:
setFlushMode
in interfaceCommonQueryContract
- Specified by:
setFlushMode
in interfaceMutationQuery
- Specified by:
setFlushMode
in interfaceQuery
- Specified by:
setFlushMode
in interfaceSelectionQuery<R>
- Specified by:
setFlushMode
in interfaceTypedQuery<R>
- See Also:
CommonQueryContract.getHibernateFlushMode()
,Session.getHibernateFlushMode()
-
setLockMode
Query<R> setLockMode(LockModeType lockMode)
Description copied from interface:SelectionQuery
Specify the rootLockModeType
for the query- Specified by:
setLockMode
in interfaceQuery
- Specified by:
setLockMode
in interfaceSelectionQuery<R>
- Specified by:
setLockMode
in interfaceTypedQuery<R>
- See Also:
SelectionQuery.setHibernateLockMode(org.hibernate.LockMode)
-
setOrder
@Incubating Query<R> setOrder(List<Order<? super R>> orderList)
Description copied from interface:SelectionQuery
If the result type of this query is an entity class, add one or more rules for ordering the query results.- Specified by:
setOrder
in interfaceSelectionQuery<R>
- Parameters:
orderList
- one or more instances ofOrder
- See Also:
Order
-
setOrder
@Incubating Query<R> setOrder(Order<? super R> order)
Description copied from interface:SelectionQuery
If the result type of this query is an entity class, add a rule for ordering the query results.- Specified by:
setOrder
in interfaceSelectionQuery<R>
- Parameters:
order
- an instance ofOrder
- See Also:
Order
-
setResultTransformer
@Deprecated(since="5.2") default <T> Query<T> setResultTransformer(ResultTransformer<T> transformer)
-
-