Class DelegatingSqmSelectionQueryImplementor<R>
- java.lang.Object
-
- org.hibernate.query.sqm.spi.DelegatingSqmSelectionQueryImplementor<R>
-
- All Implemented Interfaces:
CommonQueryContract
,SelectionQuery<R>
,SqmQuery
,SqmSelectionQueryImplementor<R>
,SqmSelectionQuery<R>
@Incubating public abstract class DelegatingSqmSelectionQueryImplementor<R> extends Object implements SqmSelectionQueryImplementor<R>
-
-
Constructor Summary
Constructors Constructor Description DelegatingSqmSelectionQueryImplementor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SqmSelectionQueryImplementor<R>
disableFetchProfile(String profileName)
Disable thefetch profile
with the given name in this session.SqmSelectionQueryImplementor<R>
enableFetchProfile(String profileName)
Enable thefetch profile
for this query.<T> T
executeQuery(ResultsConsumer<T,R> resultsConsumer)
CacheMode
getCacheMode()
Obtain theCacheMode
in effect for this query.String
getCacheRegion()
Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion onSelectionQuery.isCacheable()
for more information).CacheRetrieveMode
getCacheRetrieveMode()
CacheStoreMode
getCacheStoreMode()
String
getComment()
Get the comment that has been set for this query, if any.protected abstract SqmSelectionQueryImplementor<R>
getDelegate()
Integer
getFetchSize()
Obtain the JDBC fetch size hint in effect for this query.int
getFirstResult()
The first row position to return from the query results.FlushModeType
getFlushMode()
The JPAFlushModeType
in effect for this query.FlushMode
getHibernateFlushMode()
TheFlushMode
in effect for this query.LockMode
getHibernateLockMode()
Get the rootLockMode
for the queryKeyedResultList<R>
getKeyedResultList(KeyedPage<R> page)
Execute the query and return the results for the given page, using key-based pagination.LockModeType
getLockMode()
Get the rootLockModeType
for the queryLockOptions
getLockOptions()
TheLockOptions
currently in effect for the queryint
getMaxResults()
The max number of rows requested for the query resultsParameterMetadata
getParameterMetadata()
QueryOptions
getQueryOptions()
String
getQueryString()
long
getResultCount()
Determine the size of the query result list that would be returned by callingSelectionQuery.getResultList()
with no offset or limit applied to the query.List<R>
getResultList()
Execute the query and return the query results as aList
.Stream<R>
getResultStream()
Execute the query and return the query results as aStream
.R
getSingleResult()
Execute the query and return the single result of the query, throwing an exception if the query returns no results.R
getSingleResultOrNull()
Execute the query and return the single result of the query, ornull
if the query returns no results.SqmStatement
getSqmStatement()
Integer
getTimeout()
Obtain the query timeout in seconds.boolean
isCacheable()
Should the results of the query be stored in the second level cache?boolean
isQueryPlanCacheable()
Should the query plan of the query be stored in the query plan cache?boolean
isReadOnly()
Should entities and proxies loaded by this Query be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context i s returned instead.List<R>
list()
Execute the query and return the query results as aList
.ScrollableResults<R>
scroll()
Returns scrollable access to the query results.ScrollableResults<R>
scroll(ScrollMode scrollMode)
Returns scrollable access to the query results.@Remove SqmSelectionQueryImplementor<R>
setAliasSpecificLockMode(String alias, LockMode lockMode)
Deprecated.SqmSelectionQueryImplementor<R>
setCacheable(boolean cacheable)
Enable/disable second level query (result) caching for this query.SqmSelectionQueryImplementor<R>
setCacheMode(CacheMode cacheMode)
Set the currentCacheMode
in effect for this query.SqmSelectionQueryImplementor<R>
setCacheRegion(String cacheRegion)
Set the name of the cache region where query results should be cached (assumingSelectionQuery.isCacheable()
).SqmSelectionQueryImplementor<R>
setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode)
SqmSelectionQueryImplementor<R>
setCacheStoreMode(CacheStoreMode cacheStoreMode)
SqmSelectionQueryImplementor<R>
setComment(String comment)
Set a comment for this query.SqmSelectionQueryImplementor<R>
setEntityGraph(EntityGraph<R> graph, GraphSemantic semantic)
Apply anEntityGraph
to the query.SqmSelectionQueryImplementor<R>
setFetchSize(int fetchSize)
Sets a JDBC fetch size hint for the query.SqmSelectionQueryImplementor<R>
setFirstResult(int startPosition)
Set the first row position to return from the query results.SqmSelectionQueryImplementor<R>
setFlushMode(FlushModeType flushMode)
Set theFlushMode
in to use for this query.SqmSelectionQueryImplementor<R>
setFollowOnLocking(boolean enable)
Specifies whether follow-on locking should be appliedSqmSelectionQueryImplementor<R>
setHibernateFlushMode(FlushMode flushMode)
Set the currentFlushMode
in effect for this query.SqmSelectionQueryImplementor<R>
setHibernateLockMode(LockMode lockMode)
Specify the rootLockMode
for the querySqmSelectionQueryImplementor<R>
setHint(String hintName, Object value)
Set a hint.SqmSelectionQueryImplementor<R>
setLockMode(LockModeType lockMode)
Specify the rootLockModeType
for the querySqmSelectionQueryImplementor<R>
setLockMode(String alias, LockMode lockMode)
Specify aLockMode
to apply to a specific alias defined in the querySqmSelectionQueryImplementor<R>
setMaxResults(int maxResult)
Set the max number of rows requested for the query results.SqmSelectionQueryImplementor<R>
setOrder(List<Order<? super R>> orders)
If the result type of this query is an entity class, add one or more rules for ordering the query results.SqmSelectionQueryImplementor<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.SqmSelectionQueryImplementor<R>
setPage(Page page)
Set the page of results to return.SqmSelectionQueryImplementor<R>
setParameter(int position, Object value)
Bind the given argument to an ordinal query parameter.SqmSelectionQueryImplementor<R>
setParameter(int position, Instant value, TemporalType temporalType)
Bind anInstant
to an ordinal query parameter using just the portion indicated by the givenTemporalType
.SqmSelectionQueryImplementor<R>
setParameter(int position, Calendar value, TemporalType temporalType)
SqmSelectionQueryImplementor<R>
setParameter(int position, Date value, TemporalType temporalType)
<P> SqmSelectionQueryImplementor<R>
setParameter(int position, P value, Class<P> type)
Bind the given argument to an ordinal query parameter using the givenClass
reference to attempt to infer theBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameter(int position, P value, BindableType<P> type)
Bind the given argument to an ordinal query parameter using the givenBindableType
.SqmSelectionQueryImplementor<R>
setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
SqmSelectionQueryImplementor<R>
setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
<T> SqmSelectionQueryImplementor<R>
setParameter(Parameter<T> param, T value)
SqmSelectionQueryImplementor<R>
setParameter(String name, Object value)
Bind the given argument to a named query parameter.SqmSelectionQueryImplementor<R>
setParameter(String name, Instant value, TemporalType temporalType)
Bind anInstant
to the named query parameter using just the portion indicated by the givenTemporalType
.SqmSelectionQueryImplementor<R>
setParameter(String name, Calendar value, TemporalType temporalType)
SqmSelectionQueryImplementor<R>
setParameter(String name, Date value, TemporalType temporalType)
<P> SqmSelectionQueryImplementor<R>
setParameter(String name, P value, Class<P> type)
Bind the given argument to a named query parameter using the givenClass
reference to attempt to infer theBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameter(String name, P value, BindableType<P> type)
Bind the given argument to a named query parameter using the givenBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameter(QueryParameter<P> parameter, P value, Class<P> type)
Bind an argument to the query parameter represented by the givenQueryParameter
, using the givenClass
reference to attempt to infer theBindableType
to use.<P> SqmSelectionQueryImplementor<R>
setParameter(QueryParameter<P> parameter, P val, BindableType<P> type)
Bind an argument to the query parameter represented by the givenQueryParameter
, using the givenBindableType
.<T> SqmSelectionQueryImplementor<R>
setParameter(QueryParameter<T> parameter, T value)
Bind an argument to the query parameter represented by the givenQueryParameter
.SqmSelectionQueryImplementor<R>
setParameterList(int position, Object[] values)
Bind multiple arguments to an ordinal query parameter.SqmSelectionQueryImplementor<R>
setParameterList(int position, Collection values)
Bind multiple arguments to an ordinal query parameter.<P> SqmSelectionQueryImplementor<R>
setParameterList(int position, Collection<? extends P> values, Class<P> javaType)
Bind multiple arguments to an ordinal query parameter using the givenClass
reference to attempt to infer theBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameterList(int position, Collection<? extends P> values, BindableType<P> type)
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameterList(int position, P[] values, Class<P> javaType)
Bind multiple arguments to an ordinal query parameter using the givenClass
reference to attempt to infer theBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameterList(int position, P[] values, BindableType<P> type)
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.SqmSelectionQueryImplementor<R>
setParameterList(String name, Object[] values)
Bind multiple arguments to a named query parameter.SqmSelectionQueryImplementor<R>
setParameterList(String name, Collection values)
Bind multiple arguments to a named query parameter.<P> SqmSelectionQueryImplementor<R>
setParameterList(String name, Collection<? extends P> values, Class<P> javaType)
Bind multiple arguments to a named query parameter using the givenClass
reference to attempt to infer theBindableType
If unable to infer an appropriateBindableType
, fall back toCommonQueryContract.setParameterList(String, Collection)
.<P> SqmSelectionQueryImplementor<R>
setParameterList(String name, Collection<? extends P> values, BindableType<P> type)
Bind multiple arguments to a named query parameter using the givenBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameterList(String name, P[] values, Class<P> javaType)
Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine theBindableType
to use.<P> SqmSelectionQueryImplementor<R>
setParameterList(String name, P[] values, BindableType<P> type)
Bind multiple arguments to a named query parameter using the givenBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> values)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
.<P> SqmSelectionQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
using the givenClass
reference to attempt to infer theBindableType
to use.<P> SqmSelectionQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
, using the givenBindableType
.<P> SqmSelectionQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, P[] values)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
.<P> SqmSelectionQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
using the givenClass
reference to attempt to infer theBindableType
to use.<P> SqmSelectionQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
, using the given theBindableType
.SqmSelectionQueryImplementor<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.SqmSelectionQueryImplementor<R>
setProperties(Map bean)
Bind the values of the givenMap
to named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.SqmSelectionQueryImplementor<R>
setQueryPlanCacheable(boolean queryPlanCacheable)
Enable/disable query plan caching for this query.SqmSelectionQueryImplementor<R>
setReadOnly(boolean readOnly)
Set the read-only/modifiable mode for entities and proxies loaded by thisQuery
.SqmSelectionQueryImplementor<R>
setTimeout(int timeout)
Set the query timeout in seconds.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 anOptional
.
-
-
-
Method Detail
-
getDelegate
protected abstract SqmSelectionQueryImplementor<R> getDelegate()
-
getFlushMode
public FlushModeType getFlushMode()
Description copied from interface:CommonQueryContract
The JPAFlushModeType
in effect for this query. By default, the query inherits theFlushMode
of theSession
from which it originates.- Specified by:
getFlushMode
in interfaceCommonQueryContract
- See Also:
CommonQueryContract.getHibernateFlushMode()
,Session.getHibernateFlushMode()
-
setFlushMode
public SqmSelectionQueryImplementor<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 interfaceSelectionQuery<R>
- See Also:
CommonQueryContract.getHibernateFlushMode()
,Session.getHibernateFlushMode()
-
getHibernateFlushMode
public FlushMode getHibernateFlushMode()
Description copied from interface:CommonQueryContract
TheFlushMode
in effect for this query. By default, the query inherits theFlushMode
of theSession
from which it originates.- Specified by:
getHibernateFlushMode
in interfaceCommonQueryContract
- See Also:
Session.getHibernateFlushMode()
-
getTimeout
public Integer getTimeout()
Description copied from interface:CommonQueryContract
Obtain the query timeout in seconds.This value is eventually passed along to the JDBC statement via
Statement.setQueryTimeout(int)
.A value of zero indicates no timeout.
- Specified by:
getTimeout
in interfaceCommonQueryContract
- See Also:
Statement.getQueryTimeout()
,Statement.setQueryTimeout(int)
-
getComment
public String getComment()
Description copied from interface:CommonQueryContract
Get the comment that has been set for this query, if any.- Specified by:
getComment
in interfaceCommonQueryContract
-
setComment
public SqmSelectionQueryImplementor<R> setComment(String comment)
Description copied from interface:CommonQueryContract
Set a comment for this query.- Specified by:
setComment
in interfaceCommonQueryContract
- Specified by:
setComment
in interfaceSelectionQuery<R>
- See Also:
Query.setComment(String)
-
setHint
public SqmSelectionQueryImplementor<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 interfaceSelectionQuery<R>
- See Also:
HibernateHints
,SpecHints
-
list
public List<R> list()
Description copied from interface:SelectionQuery
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
public List<R> getResultList()
Description copied from interface:SelectionQuery
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 interfaceSelectionQuery<R>
- Returns:
- the results as a list
-
getResultCount
public long getResultCount()
Description copied from interface:SelectionQuery
Determine the size of the query result list that would be returned by callingSelectionQuery.getResultList()
with no offset or limit applied to the query.- Specified by:
getResultCount
in interfaceSelectionQuery<R>
- Returns:
- the size of the list that would be returned
-
getKeyedResultList
public KeyedResultList<R> getKeyedResultList(KeyedPage<R> page)
Description copied from interface:SelectionQuery
Execute the query and return the results for the given page, using key-based pagination.- Specified by:
getKeyedResultList
in interfaceSelectionQuery<R>
- Parameters:
page
- the key-based specification of the page as an instance ofKeyedPage
- Returns:
- the query results and the key of the next page
as an instance of
KeyedResultList
- See Also:
KeyedPage
,KeyedResultList
-
scroll
public ScrollableResults<R> scroll()
Description copied from interface:SelectionQuery
Returns scrollable access to the query results.This form calls
SelectionQuery.scroll(ScrollMode)
usingDialect.defaultScrollMode()
- Specified by:
scroll
in interfaceSelectionQuery<R>
-
scroll
public ScrollableResults<R> scroll(ScrollMode scrollMode)
Description copied from interface:SelectionQuery
Returns scrollable access to the query results. The capabilities of the returned ScrollableResults depend on the specified ScrollMode.- Specified by:
scroll
in interfaceSelectionQuery<R>
-
getResultStream
public Stream<R> getResultStream()
Description copied from interface:SelectionQuery
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 interfaceSelectionQuery<R>
- Returns:
- The results as a
Stream
-
stream
public Stream<R> stream()
Description copied from interface:SelectionQuery
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
-
uniqueResult
public R uniqueResult()
Description copied from interface:SelectionQuery
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
-
getSingleResult
public R getSingleResult()
Description copied from interface:SelectionQuery
Execute the query and return the single result of the query, throwing an exception if the query returns no results.- Specified by:
getSingleResult
in interfaceSelectionQuery<R>
- Returns:
- the single result, only if there is exactly one
-
getSingleResultOrNull
public R getSingleResultOrNull()
Description copied from interface:SelectionQuery
Execute the query and return the single result of the query, ornull
if the query returns no results.- Specified by:
getSingleResultOrNull
in interfaceSelectionQuery<R>
- Returns:
- the single result or
null
if there is no result to return
-
uniqueResultOptional
public Optional<R> uniqueResultOptional()
Description copied from interface:SelectionQuery
Execute the query and return the single result of the query, as anOptional
.- Specified by:
uniqueResultOptional
in interfaceSelectionQuery<R>
- Returns:
- the single result as an
Optional
-
setEntityGraph
public SqmSelectionQueryImplementor<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
public SqmSelectionQueryImplementor<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
public SqmSelectionQueryImplementor<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
-
getFetchSize
public Integer getFetchSize()
Description copied from interface:SelectionQuery
Obtain the JDBC fetch size hint in effect for this query. This value is eventually passed along to the JDBC query viaStatement.setFetchSize(int)
. As defined by JDBC, this value is a hint to the driver to indicate how many rows to fetch from the database when more rows are needed.- Specified by:
getFetchSize
in interfaceSelectionQuery<R>
- Returns:
- The timeout in seconds
- See Also:
Statement.getFetchSize()
,Statement.setFetchSize(int)
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:SelectionQuery
Should entities and proxies loaded by this Query be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context i s returned instead.- Specified by:
isReadOnly
in interfaceSelectionQuery<R>
- Returns:
true
if the entities and proxies loaded by the query will be put in read-only mode;false
otherwise (they will be modifiable)- See Also:
SelectionQuery.setReadOnly(boolean)
,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.
-
getMaxResults
public int getMaxResults()
Description copied from interface:SelectionQuery
The max number of rows requested for the query results- Specified by:
getMaxResults
in interfaceSelectionQuery<R>
-
setMaxResults
public SqmSelectionQueryImplementor<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 interfaceSelectionQuery<R>
-
getFirstResult
public int getFirstResult()
Description copied from interface:SelectionQuery
The first row position to return from the query results. Applied to the SQL query.- Specified by:
getFirstResult
in interfaceSelectionQuery<R>
-
setFirstResult
public SqmSelectionQueryImplementor<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 interfaceSelectionQuery<R>
-
setPage
@Incubating public SqmSelectionQueryImplementor<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
-
getCacheMode
public CacheMode getCacheMode()
Description copied from interface:SelectionQuery
Obtain theCacheMode
in effect for this query. By default, the query inherits theCacheMode
of the session from which it originates.The
CacheMode
here describes reading-from/writing-to the entity/collection caches as we process query results. For caching of the actual query results, seeSelectionQuery.isCacheable()
andSelectionQuery.getCacheRegion()
In order for this setting to have any affect, second-level caching would have to be enabled and the entities/collections in question configured for caching.
- Specified by:
getCacheMode
in interfaceSelectionQuery<R>
- See Also:
Session.getCacheMode()
-
getCacheStoreMode
public CacheStoreMode getCacheStoreMode()
- Specified by:
getCacheStoreMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.getCacheMode()
-
getCacheRetrieveMode
public CacheRetrieveMode getCacheRetrieveMode()
- Specified by:
getCacheRetrieveMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.getCacheMode()
-
setCacheStoreMode
public SqmSelectionQueryImplementor<R> setCacheStoreMode(CacheStoreMode cacheStoreMode)
- Specified by:
setCacheStoreMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.setCacheMode(CacheMode)
-
setCacheRetrieveMode
public SqmSelectionQueryImplementor<R> setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode)
- Specified by:
setCacheRetrieveMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.setCacheMode(CacheMode)
-
isCacheable
public boolean isCacheable()
Description copied from interface:SelectionQuery
Should the results of the query be stored in the second level cache?This is different to second level caching of any returned entities and collections, which is controlled by
SelectionQuery.getCacheMode()
.The query being "eligible" for caching does not necessarily mean its results will be cached. Second-level query caching still has to be enabled on the
SessionFactory
for this to happen. Usually that is controlled by the configuration setting "hibernate.cache.use_query_cache".- Specified by:
isCacheable
in interfaceSelectionQuery<R>
-
isQueryPlanCacheable
public boolean isQueryPlanCacheable()
Description copied from interface:SelectionQuery
Should the query plan of the query be stored in the query plan cache?- Specified by:
isQueryPlanCacheable
in interfaceSelectionQuery<R>
-
setQueryPlanCacheable
public SqmSelectionQueryImplementor<R> setQueryPlanCacheable(boolean queryPlanCacheable)
Description copied from interface:SelectionQuery
Enable/disable query plan caching for this query.- Specified by:
setQueryPlanCacheable
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.isQueryPlanCacheable()
-
getCacheRegion
public String getCacheRegion()
Description copied from interface:SelectionQuery
Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion onSelectionQuery.isCacheable()
for more information).null
indicates that the default region should be used.- Specified by:
getCacheRegion
in interfaceSelectionQuery<R>
-
getLockOptions
public LockOptions getLockOptions()
Description copied from interface:SelectionQuery
TheLockOptions
currently in effect for the query- Specified by:
getLockOptions
in interfaceSelectionQuery<R>
-
getLockMode
public LockModeType getLockMode()
Description copied from interface:SelectionQuery
Get the rootLockModeType
for the query- Specified by:
getLockMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.getHibernateLockMode()
-
setLockMode
public SqmSelectionQueryImplementor<R> setLockMode(LockModeType lockMode)
Description copied from interface:SelectionQuery
Specify the rootLockModeType
for the query- Specified by:
setLockMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.setHibernateLockMode(org.hibernate.LockMode)
-
getHibernateLockMode
public LockMode getHibernateLockMode()
Description copied from interface:SelectionQuery
Get the rootLockMode
for the query- Specified by:
getHibernateLockMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.getLockMode()
-
setHibernateLockMode
public SqmSelectionQueryImplementor<R> setHibernateLockMode(LockMode lockMode)
Description copied from interface:SelectionQuery
Specify the rootLockMode
for the query- Specified by:
setHibernateLockMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.setLockMode(LockModeType)
-
setLockMode
public SqmSelectionQueryImplementor<R> setLockMode(String alias, LockMode lockMode)
Description copied from interface:SelectionQuery
Specify aLockMode
to apply to a specific alias defined in the query- Specified by:
setLockMode
in interfaceSelectionQuery<R>
-
setOrder
@Incubating public SqmSelectionQueryImplementor<R> setOrder(List<Order<? super R>> orders)
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:
orders
- one or more instances ofOrder
- See Also:
Order
-
setOrder
@Incubating public SqmSelectionQueryImplementor<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
-
setAliasSpecificLockMode
@Remove @Deprecated(since="6.2") public @Remove SqmSelectionQueryImplementor<R> setAliasSpecificLockMode(String alias, LockMode lockMode)
Deprecated.Description copied from interface:SelectionQuery
Specify aLockMode
to apply to a specific alias defined in the query- Specified by:
setAliasSpecificLockMode
in interfaceSelectionQuery<R>
-
setFollowOnLocking
public SqmSelectionQueryImplementor<R> setFollowOnLocking(boolean enable)
Description copied from interface:SelectionQuery
Specifies whether follow-on locking should be applied- Specified by:
setFollowOnLocking
in interfaceSelectionQuery<R>
-
getQueryString
public String getQueryString()
- Specified by:
getQueryString
in interfaceSqmQuery
-
getSqmStatement
public SqmStatement getSqmStatement()
- Specified by:
getSqmStatement
in interfaceSqmQuery
-
getParameterMetadata
public ParameterMetadata getParameterMetadata()
- Specified by:
getParameterMetadata
in interfaceSqmQuery
-
getQueryOptions
public QueryOptions getQueryOptions()
- Specified by:
getQueryOptions
in interfaceSqmQuery
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(String name, Object value)
Description copied from interface:CommonQueryContract
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 which accepts a "type".
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
CommonQueryContract.setParameter(String, Object, Class)
,CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(String name, P value, Class<P> type)
Description copied from interface:CommonQueryContract
Bind the given argument to a named query parameter using the givenClass
reference to attempt to infer theBindableType
. If unable to infer an appropriateBindableType
, fall back toCommonQueryContract.setParameter(String, Object)
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(String name, P value, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind the given argument to a named query parameter using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(String name, Instant value, TemporalType temporalType)
Description copied from interface:CommonQueryContract
Bind anInstant
to the named query parameter using just the portion indicated by the givenTemporalType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(String name, Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
Query.setParameter(String, Calendar, TemporalType)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(String name, Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
Query.setParameter(String, Date, TemporalType)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(int position, Object value)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
CommonQueryContract.setParameter(int, Object, Class)
,CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(int position, P value, Class<P> type)
Description copied from interface:CommonQueryContract
Bind the given argument to an ordinal query parameter using the givenClass
reference to attempt to infer theBindableType
. If unable to infer an appropriateBindableType
, fall back toCommonQueryContract.setParameter(int, Object)
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(int position, P value, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind the given argument to an ordinal query parameter using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(int position, Instant value, TemporalType temporalType)
Description copied from interface:CommonQueryContract
Bind anInstant
to an ordinal query parameter using just the portion indicated by the givenTemporalType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(int position, Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
Query.setParameter(int, Date, TemporalType)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(int position, Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
Query.setParameter(int, Calendar, TemporalType)
-
setParameter
public <T> SqmSelectionQueryImplementor<R> setParameter(QueryParameter<T> parameter, T value)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- Parameters:
parameter
- the query parameter mementovalue
- the argument, which might be null- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(QueryParameter<P> parameter, P value, Class<P> type)
Description copied from interface:CommonQueryContract
Bind an argument to the query parameter represented by the givenQueryParameter
, using the givenClass
reference to attempt to infer theBindableType
to use. If unable to infer an appropriateBindableType
, fall back toCommonQueryContract.setParameter(QueryParameter, Object)
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- Parameters:
parameter
- the query parameter mementovalue
- the argument, which might be nulltype
- aBindableType
representing the type of the parameter- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(QueryParameter<P> parameter, P val, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind an argument to the query parameter represented by the givenQueryParameter
, using the givenBindableType
.- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- Parameters:
parameter
- the query parameter mementoval
- the argument, which might be nulltype
- aBindableType
representing the type of the parameter- Returns:
this
, for method chaining
-
setParameter
public <T> SqmSelectionQueryImplementor<R> setParameter(Parameter<T> param, T value)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
Query.setParameter(Parameter, Object)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
Query.setParameter(Parameter, Calendar, TemporalType)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Specified by:
setParameter
in interfaceSqmQuery
- Specified by:
setParameter
in interfaceSqmSelectionQuery<R>
- See Also:
Query.setParameter(Parameter, Date, TemporalType)
-
setParameterList
public SqmSelectionQueryImplementor<R> setParameterList(String name, Collection values)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, java.util.Collection, BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(String name, Collection<? extends P> values, Class<P> javaType)
Description copied from interface:CommonQueryContract
Bind multiple arguments to a named query parameter using the givenClass
reference to attempt to infer theBindableType
If unable to infer an appropriateBindableType
, fall back toCommonQueryContract.setParameterList(String, Collection)
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, java.util.Collection, BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(String name, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind multiple arguments to a named query parameter using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setParameterList
public SqmSelectionQueryImplementor<R> setParameterList(String name, Object[] values)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(String name, P[] values, Class<P> javaType)
Description copied from interface:CommonQueryContract
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
,CommonQueryContract.setParameterList(String, Collection)
is used- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, Object[], BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(String name, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind multiple arguments to a named query parameter using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setParameterList
public SqmSelectionQueryImplementor<R> setParameterList(int position, Collection values)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(int position, Collection<? extends P> values, Class<P> javaType)
Description copied from interface:CommonQueryContract
Bind multiple arguments to an ordinal query parameter using the givenClass
reference to attempt to infer theBindableType
. If unable to infer an appropriateBindableType
, fall back toCommonQueryContract.setParameterList(String, Collection)
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(int, Collection, BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(int position, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setParameterList
public SqmSelectionQueryImplementor<R> setParameterList(int position, Object[] values)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(int position, P[] values, Class<P> javaType)
Description copied from interface:CommonQueryContract
Bind multiple arguments to an ordinal query parameter using the givenClass
reference to attempt to infer theBindableType
. If unable to infer an appropriateBindableType
, fall back toCommonQueryContract.setParameterList(String, Collection)
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(int, Object[], BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(int position, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> values)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Parameters:
parameter
- the parameter mementovalues
- a collection of arguments- Returns:
this
, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType)
Description copied from interface:CommonQueryContract
Bind multiple arguments to the query parameter represented by the givenQueryParameter
using the givenClass
reference to attempt to infer theBindableType
to use. If unable to infer an appropriateBindableType
, fall back to usingCommonQueryContract.setParameterList(String, Collection)
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(QueryParameter, java.util.Collection, BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind multiple arguments to the query parameter represented by the givenQueryParameter
, using the givenBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, P[] values)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Parameters:
parameter
- the parameter mementovalues
- a collection of arguments- Returns:
this
, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType)
Description copied from interface:CommonQueryContract
Bind multiple arguments to the query parameter represented by the givenQueryParameter
using the givenClass
reference to attempt to infer theBindableType
to use. If unable to infer an appropriateBindableType
, fall back to usingCommonQueryContract.setParameterList(String, Collection)
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(QueryParameter, Object[], BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContract
Bind multiple arguments to the query parameter represented by the givenQueryParameter
, using the given theBindableType
.- Specified by:
setParameterList
in interfaceCommonQueryContract
- Specified by:
setParameterList
in interfaceSelectionQuery<R>
- Specified by:
setParameterList
in interfaceSqmQuery
- Specified by:
setParameterList
in interfaceSqmSelectionQuery<R>
- Returns:
this
, for method chaining
-
setProperties
public SqmSelectionQueryImplementor<R> setProperties(Object bean)
Description copied from interface:CommonQueryContract
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 interfaceSelectionQuery<R>
- Specified by:
setProperties
in interfaceSqmQuery
- Specified by:
setProperties
in interfaceSqmSelectionQuery<R>
- Parameters:
bean
- any JavaBean or POJO- Returns:
this
, for method chaining
-
setProperties
public SqmSelectionQueryImplementor<R> setProperties(Map bean)
Description copied from interface:CommonQueryContract
Bind the values of the givenMap
to 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 interfaceSelectionQuery<R>
- Specified by:
setProperties
in interfaceSqmQuery
- Specified by:
setProperties
in interfaceSqmSelectionQuery<R>
- Parameters:
bean
- aMap
of names to arguments- Returns:
this
, for method chaining
-
setHibernateFlushMode
public SqmSelectionQueryImplementor<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 interfaceSelectionQuery<R>
- Specified by:
setHibernateFlushMode
in interfaceSqmQuery
- Specified by:
setHibernateFlushMode
in interfaceSqmSelectionQuery<R>
- See Also:
CommonQueryContract.getHibernateFlushMode()
,Session.getHibernateFlushMode()
-
setCacheMode
public SqmSelectionQueryImplementor<R> setCacheMode(CacheMode cacheMode)
Description copied from interface:SelectionQuery
Set the currentCacheMode
in effect for this query.- Specified by:
setCacheMode
in interfaceSelectionQuery<R>
- Specified by:
setCacheMode
in interfaceSqmSelectionQuery<R>
- See Also:
SelectionQuery.getCacheMode()
,Session.setCacheMode(CacheMode)
-
setCacheable
public SqmSelectionQueryImplementor<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>
- Specified by:
setCacheable
in interfaceSqmSelectionQuery<R>
- See Also:
SelectionQuery.isCacheable()
-
setCacheRegion
public SqmSelectionQueryImplementor<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>
- Specified by:
setCacheRegion
in interfaceSqmSelectionQuery<R>
- See Also:
SelectionQuery.getCacheRegion()
-
setTimeout
public SqmSelectionQueryImplementor<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 interfaceSelectionQuery<R>
- Specified by:
setTimeout
in interfaceSqmSelectionQuery<R>
- Parameters:
timeout
- the timeout in seconds- Returns:
this
, for method chaining- See Also:
CommonQueryContract.getTimeout()
-
setFetchSize
public SqmSelectionQueryImplementor<R> setFetchSize(int fetchSize)
Description copied from interface:SelectionQuery
Sets a JDBC fetch size hint for the query.- Specified by:
setFetchSize
in interfaceSelectionQuery<R>
- Specified by:
setFetchSize
in interfaceSqmSelectionQuery<R>
- Parameters:
fetchSize
- the fetch size hint- Returns:
this
, for method chaining- See Also:
SelectionQuery.getFetchSize()
-
setReadOnly
public SqmSelectionQueryImplementor<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>
- Specified by:
setReadOnly
in interfaceSqmSelectionQuery<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
-
executeQuery
public <T> T executeQuery(ResultsConsumer<T,R> resultsConsumer)
- Specified by:
executeQuery
in interfaceSqmSelectionQueryImplementor<R>
-
-