Class AbstractSelectionQuery<R>
- java.lang.Object
-
- org.hibernate.query.spi.AbstractCommonQueryContract
-
- org.hibernate.query.spi.AbstractSelectionQuery<R>
-
- All Implemented Interfaces:
CommonQueryContract
,SelectionQuery<R>
,DomainQueryExecutionContext
- Direct Known Subclasses:
AbstractQuery
,QuerySqmImpl
,SqmSelectionQueryImpl
public abstract class AbstractSelectionQuery<R> extends AbstractCommonQueryContract implements SelectionQuery<R>, DomainQueryExecutionContext
-
-
Field Summary
Fields Modifier and Type Field Description static String
CRITERIA_HQL_STRING
The value used forgetQueryString()
for Criteria-based queries
-
Constructor Summary
Constructors Modifier Constructor Description AbstractSelectionQuery(SharedSessionContractImplementor session)
protected
AbstractSelectionQuery(AbstractSelectionQuery<?> original)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
afterQuery()
protected void
afterQuery(boolean success)
protected void
afterQueryHandlingFetchProfiles(boolean success, HashSet<String> fetchProfiles)
protected void
applyOptions(NamedQueryMemento memento)
protected void
beforeQuery()
protected HashSet<String>
beforeQueryHandlingFetchProfiles()
protected void
collectHints(Map<String,Object> hints)
SelectionQuery<R>
disableFetchProfile(String profileName)
Disable thefetch profile
with the given name in this session.protected abstract List<R>
doList()
protected abstract ScrollableResultsImplementor<R>
doScroll(ScrollMode scrollMode)
SelectionQuery<R>
enableFetchProfile(String profileName)
Enable thefetch profile
for this query.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()
Callback
getCallback()
The callback referenceInteger
getFetchSize()
Obtain the JDBC fetch size hint in effect for this query.FlushModeType
getFlushMode()
The JPAFlushModeType
in effect for this query.LockMode
getHibernateLockMode()
Get the root LockMode for the queryLockModeType
getLockMode()
Get the rootLockModeType
for the queryLockOptions
getLockOptions()
TheLockOptions
currently in effect for the queryprotected abstract String
getQueryString()
Stream<R>
getResultStream()
Execute the query and return the query results as aStream
.SessionFactoryImplementor
getSessionFactory()
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.boolean
hasCallbackActions()
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
.protected abstract void
prepareForExecution()
protected boolean
requiresTxn(LockMode lockMode)
protected void
resetCallback()
ScrollableResultsImplementor<R>
scroll()
Returns scrollable access to the query results.ScrollableResultsImplementor<R>
scroll(ScrollMode scrollMode)
Returns scrollable access to the query results.SelectionQuery<R>
setAliasSpecificLockMode(String alias, LockMode lockMode)
Deprecated.SelectionQuery<R>
setCacheable(boolean cacheable)
Enable/disable second level query (result) caching for this query.SelectionQuery<R>
setCacheMode(CacheMode cacheMode)
Set the currentCacheMode
in effect for this query.SelectionQuery<R>
setCacheRegion(String regionName)
Set the name of the cache region where query results should be cached (assumingSelectionQuery.isCacheable()
).SelectionQuery<R>
setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode)
SelectionQuery<R>
setCacheStoreMode(CacheStoreMode cacheStoreMode)
SelectionQuery<R>
setComment(String comment)
Set a comment for this query.SelectionQuery<R>
setEntityGraph(EntityGraph<R> graph, GraphSemantic semantic)
Apply anEntityGraph
to the query.SelectionQuery<R>
setFetchSize(int fetchSize)
Sets a JDBC fetch size hint for the query.SelectionQuery<R>
setFirstResult(int startPosition)
Set the first row position to return from the query results.SelectionQuery<R>
setFlushMode(FlushModeType flushMode)
Set theFlushMode
in to use for this query.SelectionQuery<R>
setFollowOnLocking(boolean enable)
Specifies whether follow-on locking should be applied?SelectionQuery<R>
setHibernateFlushMode(FlushMode flushMode)
Set the currentFlushMode
in effect for this query.SelectionQuery<R>
setHibernateLockMode(LockMode lockMode)
Specify the root LockMode for the querySelectionQuery<R>
setHint(String hintName, Object value)
Set a hint.SelectionQuery<R>
setLockMode(LockModeType lockMode)
Specify the root LockModeType for the querySelectionQuery<R>
setLockMode(String alias, LockMode lockMode)
Specify aLockMode
to apply to a specific alias defined in the querySelectionQuery<R>
setMaxResults(int maxResult)
Set the max number of rows requested for the query results.SelectionQuery<R>
setParameter(int position, Object value)
Bind the given argument to an ordinal query parameter.SelectionQuery<R>
setParameter(int position, Instant value, TemporalType temporalType)
Bind anInstant
to an ordinal query parameter using just the portion indicated by the givenTemporalType
.SelectionQuery<R>
setParameter(int position, Calendar value, TemporalType temporalType)
SelectionQuery<R>
setParameter(int position, Date value, TemporalType temporalType)
<P> SelectionQuery<R>
setParameter(int position, P value, Class<P> javaType)
Bind the given argument to an ordinal query parameter using the givenClass
reference to attempt to infer theBindableType
.<P> SelectionQuery<R>
setParameter(int position, P value, BindableType<P> type)
Bind the given argument to an ordinal query parameter using the givenBindableType
.SelectionQuery<R>
setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
SelectionQuery<R>
setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
<P> SelectionQuery<R>
setParameter(Parameter<P> parameter, P value)
SelectionQuery<R>
setParameter(String name, Object value)
Bind the given argument to a named query parameter.SelectionQuery<R>
setParameter(String name, Instant value, TemporalType temporalType)
Bind anInstant
to the named query parameter using just the portion indicated by the givenTemporalType
.SelectionQuery<R>
setParameter(String name, Calendar value, TemporalType temporalType)
SelectionQuery<R>
setParameter(String name, Date value, TemporalType temporalType)
<P> SelectionQuery<R>
setParameter(String name, P value, Class<P> javaType)
Bind the given argument to a named query parameter using the givenClass
reference to attempt to infer theBindableType
.<P> SelectionQuery<R>
setParameter(String name, P value, BindableType<P> type)
Bind the given argument to a named query parameter using the givenBindableType
.<P> SelectionQuery<R>
setParameter(QueryParameter<P> parameter, P value)
Bind an argument to the query parameter represented by the givenQueryParameter
.<P> SelectionQuery<R>
setParameter(QueryParameter<P> parameter, P value, Class<P> javaType)
Bind an argument to the query parameter represented by the givenQueryParameter
, using the givenClass
reference to attempt to infer theBindableType
to use.<P> SelectionQuery<R>
setParameter(QueryParameter<P> parameter, P value, BindableType<P> type)
Bind an argument to the query parameter represented by the givenQueryParameter
, using the givenBindableType
.SelectionQuery<R>
setParameterList(int position, Object[] values)
Bind multiple arguments to an ordinal query parameter.SelectionQuery<R>
setParameterList(int position, Collection values)
Bind multiple arguments to an ordinal query parameter.<P> SelectionQuery<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> SelectionQuery<R>
setParameterList(int position, Collection<? extends P> values, BindableType<P> type)
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.<P> SelectionQuery<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> SelectionQuery<R>
setParameterList(int position, P[] values, BindableType<P> type)
Bind multiple arguments to an ordinal query parameter using the givenBindableType
.SelectionQuery<R>
setParameterList(String name, Object[] values)
Bind multiple arguments to a named query parameter.SelectionQuery<R>
setParameterList(String name, Collection values)
Bind multiple arguments to a named query parameter.<P> SelectionQuery<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> SelectionQuery<R>
setParameterList(String name, Collection<? extends P> values, BindableType<P> type)
Bind multiple arguments to a named query parameter using the givenBindableType
.<P> SelectionQuery<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> SelectionQuery<R>
setParameterList(String name, P[] values, BindableType<P> type)
Bind multiple arguments to a named query parameter using the givenBindableType
.<P> SelectionQuery<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> values)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
.<P> SelectionQuery<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> SelectionQuery<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> SelectionQuery<R>
setParameterList(QueryParameter<P> parameter, P[] values)
Bind multiple arguments to the query parameter represented by the givenQueryParameter
.<P> SelectionQuery<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> SelectionQuery<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
.SelectionQuery<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.SelectionQuery<R>
setProperties(Map map)
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.SelectionQuery<R>
setQueryPlanCacheable(boolean queryPlanCacheable)
Enable/disable query plan caching for this query.SelectionQuery<R>
setReadOnly(boolean readOnly)
Set the read-only/modifiable mode for entities and proxies loaded by thisQuery
.SelectionQuery<R>
setTimeout(int timeout)
Set the query timeout in seconds.Stream
stream()
Execute the query and return the query results as aStream
.protected static <T> T
uniqueElement(List<T> list)
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
.-
Methods inherited from class org.hibernate.query.spi.AbstractCommonQueryContract
applyAdditionalPossibleHints, applyAliasSpecificLockModeHint, applyCacheableHint, applyCacheModeHint, applyCacheRegionHint, applyCommentHint, applyDatabaseHint, applyEntityGraphHint, applyFetchSizeHint, applyFirstResult, applyFlushModeHint, applyFollowOnLockingHint, applyGraph, applyGraph, applyHibernateLockMode, applyHint, applyJpaCacheRetrieveModeHint, applyJpaCacheStoreModeHint, applyJpaFlushMode, applyLockModeHint, applyLockModeType, applyLockTimeoutHint, applyLockTimeoutHint, applyMaxResults, applyQueryPlanCacheableHint, applyResultListTransformer, applySelectionHint, applySynchronizeSpacesHint, applyTimeoutHint, applyTupleTransformer, determineType, getComment, getFirstResult, getHibernateFlushMode, getHints, getIntegerLiteral, getJpaFlushMode, getMaxResults, getMaxRows, getParameter, getParameter, getParameter, getParameter, getParameterMetadata, getParameters, getParameterValue, getParameterValue, getParameterValue, getQueryOptions, getQueryParameterBindings, getSession, getTimeout, isBound, locateBinding, locateBinding, locateBinding, locateBinding, putIfNotNull, putIfNotNull, resolveJdbcParameterTypeIfNecessary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.query.CommonQueryContract
getComment, getHibernateFlushMode, getTimeout
-
Methods inherited from interface org.hibernate.query.spi.DomainQueryExecutionContext
getQueryOptions, getQueryParameterBindings, getResultType, getSession
-
Methods inherited from interface org.hibernate.query.SelectionQuery
getFirstResult, getKeyedResultList, getMaxResults, getResultCount, getResultList, setOrder, setOrder, setPage
-
-
-
-
Field Detail
-
CRITERIA_HQL_STRING
public static final String CRITERIA_HQL_STRING
The value used forgetQueryString()
for Criteria-based queries- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractSelectionQuery
public AbstractSelectionQuery(SharedSessionContractImplementor session)
-
AbstractSelectionQuery
protected AbstractSelectionQuery(AbstractSelectionQuery<?> original)
-
-
Method Detail
-
applyOptions
protected void applyOptions(NamedQueryMemento memento)
-
getQueryString
protected abstract String getQueryString()
-
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
-
beforeQuery
protected void beforeQuery()
-
prepareForExecution
protected abstract void prepareForExecution()
-
afterQueryHandlingFetchProfiles
protected void afterQueryHandlingFetchProfiles(boolean success, HashSet<String> fetchProfiles)
-
afterQuery
protected void afterQuery(boolean success)
-
afterQuery
protected void afterQuery()
-
requiresTxn
protected boolean requiresTxn(LockMode lockMode)
-
scroll
public ScrollableResultsImplementor<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 ScrollableResultsImplementor<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>
-
doScroll
protected abstract ScrollableResultsImplementor<R> doScroll(ScrollMode scrollMode)
-
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 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
-
uniqueElement
protected static <T> T uniqueElement(List<T> list) throws NonUniqueResultException
- Throws:
NonUniqueResultException
-
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
-
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
-
getCallback
public Callback getCallback()
Description copied from interface:DomainQueryExecutionContext
The callback reference- Specified by:
getCallback
in interfaceDomainQueryExecutionContext
-
hasCallbackActions
public boolean hasCallbackActions()
- Specified by:
hasCallbackActions
in interfaceDomainQueryExecutionContext
-
resetCallback
protected void resetCallback()
-
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 SelectionQuery<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()
-
setMaxResults
public SelectionQuery<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>
-
setFirstResult
public SelectionQuery<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>
-
setHint
public SelectionQuery<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>
- Overrides:
setHint
in classAbstractCommonQueryContract
- See Also:
HibernateHints
,SpecHints
-
setEntityGraph
public SelectionQuery<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 SelectionQuery<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 SelectionQuery<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
-
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 SelectionQuery<R> setLockMode(LockModeType lockMode)
Specify the root LockModeType for the query- Specified by:
setLockMode
in interfaceSelectionQuery<R>
- See Also:
setHibernateLockMode(org.hibernate.LockMode)
-
setLockMode
public SelectionQuery<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>
-
getHibernateLockMode
public LockMode getHibernateLockMode()
Get the root LockMode for the query- Specified by:
getHibernateLockMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.getLockMode()
-
setHibernateLockMode
public SelectionQuery<R> setHibernateLockMode(LockMode lockMode)
Specify the root LockMode for the query- Specified by:
setHibernateLockMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.setLockMode(LockModeType)
-
setAliasSpecificLockMode
@Deprecated public SelectionQuery<R> setAliasSpecificLockMode(String alias, LockMode lockMode)
Deprecated.Specify a LockMode to apply to a specific alias defined in the query- Specified by:
setAliasSpecificLockMode
in interfaceSelectionQuery<R>
-
setFollowOnLocking
public SelectionQuery<R> setFollowOnLocking(boolean enable)
Specifies whether follow-on locking should be applied?- Specified by:
setFollowOnLocking
in interfaceSelectionQuery<R>
-
collectHints
protected void collectHints(Map<String,Object> hints)
- Overrides:
collectHints
in classAbstractCommonQueryContract
-
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)
-
setFetchSize
public SelectionQuery<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()
-
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.
-
setReadOnly
public SelectionQuery<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
-
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()
-
setCacheMode
public SelectionQuery<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)
-
setCacheRetrieveMode
public SelectionQuery<R> setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode)
- Specified by:
setCacheRetrieveMode
in interfaceSelectionQuery<R>
- See Also:
SelectionQuery.setCacheMode(CacheMode)
-
setCacheStoreMode
public SelectionQuery<R> setCacheStoreMode(CacheStoreMode cacheStoreMode)
- Specified by:
setCacheStoreMode
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>
-
setCacheable
public SelectionQuery<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()
-
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 SelectionQuery<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>
-
setCacheRegion
public SelectionQuery<R> setCacheRegion(String regionName)
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()
-
setHibernateFlushMode
public SelectionQuery<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>
- Overrides:
setHibernateFlushMode
in classAbstractCommonQueryContract
- See Also:
CommonQueryContract.getHibernateFlushMode()
,Session.getHibernateFlushMode()
-
setTimeout
public SelectionQuery<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>
- Overrides:
setTimeout
in classAbstractCommonQueryContract
- Parameters:
timeout
- the timeout in seconds- Returns:
this
, for method chaining- See Also:
CommonQueryContract.getTimeout()
-
setComment
public SelectionQuery<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>
- Overrides:
setComment
in classAbstractCommonQueryContract
- See Also:
Query.setComment(String)
-
setParameter
public SelectionQuery<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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
CommonQueryContract.setParameter(String, Object, Class)
,CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
public <P> SelectionQuery<R> setParameter(String name, P value, Class<P> javaType)
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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
public <P> SelectionQuery<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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
-
setParameter
public SelectionQuery<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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
-
setParameter
public SelectionQuery<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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
CommonQueryContract.setParameter(int, Object, Class)
,CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
public <P> SelectionQuery<R> setParameter(int position, P value, Class<P> javaType)
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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
public <P> SelectionQuery<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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
-
setParameter
public SelectionQuery<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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
-
setParameter
public <P> SelectionQuery<R> setParameter(QueryParameter<P> parameter, P 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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- 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> SelectionQuery<R> setParameter(QueryParameter<P> parameter, P value, Class<P> javaType)
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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- Parameters:
parameter
- the query parameter mementovalue
- the argument, which might be nulljavaType
- aBindableType
representing the type of the parameter- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
public <P> SelectionQuery<R> setParameter(QueryParameter<P> parameter, P value, 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>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- Parameters:
parameter
- the query parameter mementovalue
- the argument, which might be nulltype
- aBindableType
representing the type of the parameter- Returns:
this
, for method chaining
-
setParameter
public <P> SelectionQuery<R> setParameter(Parameter<P> parameter, P value)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
Query.setParameter(Parameter, Object)
-
setParameter
public SelectionQuery<R> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
Query.setParameter(Parameter, Calendar, TemporalType)
-
setParameter
public SelectionQuery<R> setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
Query.setParameter(Parameter, Date, TemporalType)
-
setParameter
public SelectionQuery<R> setParameter(String name, Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
Query.setParameter(String, Calendar, TemporalType)
-
setParameter
public SelectionQuery<R> setParameter(String name, Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
Query.setParameter(String, Date, TemporalType)
-
setParameter
public SelectionQuery<R> setParameter(int position, Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
Query.setParameter(int, Calendar, TemporalType)
-
setParameter
public SelectionQuery<R> setParameter(int position, Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
Query.setParameter(int, Date, TemporalType)
-
setParameterList
public SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, java.util.Collection, BindableType)
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, java.util.Collection, BindableType)
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setParameterList
public SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, Object[], BindableType)
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setParameterList
public SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(int, Collection, BindableType)
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setParameterList
public SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(int, Object[], BindableType)
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Parameters:
parameter
- the parameter mementovalues
- a collection of arguments- Returns:
this
, for method chaining
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(QueryParameter, java.util.Collection, BindableType)
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Parameters:
parameter
- the parameter mementovalues
- a collection of arguments- Returns:
this
, for method chaining
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining- See Also:
CommonQueryContract.setParameterList(QueryParameter, Object[], BindableType)
-
setParameterList
public <P> SelectionQuery<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>
- Overrides:
setParameterList
in classAbstractCommonQueryContract
- Returns:
this
, for method chaining
-
setProperties
public SelectionQuery<R> setProperties(Map map)
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>
- Overrides:
setProperties
in classAbstractCommonQueryContract
- Parameters:
map
- aMap
of names to arguments- Returns:
this
, for method chaining
-
setProperties
public SelectionQuery<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>
- Overrides:
setProperties
in classAbstractCommonQueryContract
- Parameters:
bean
- any JavaBean or POJO- Returns:
this
, for method chaining
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
-
-