Class AbstractSelectionQuery<R>
- All Implemented Interfaces:
CommonQueryContract
,SelectionQuery<R>
,DomainQueryExecutionContext
- Direct Known Subclasses:
AbstractQuery
,QuerySqmImpl
,SqmSelectionQueryImpl
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The value used forgetQueryString()
for Criteria-based queries -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
afterQuery
(boolean success) protected void
afterQueryHandlingFetchProfiles
(boolean success, HashSet<String> fetchProfiles) protected void
applyOptions
(NamedQueryMemento memento) protected void
protected void
collectHints
(Map<String, Object> hints) disableFetchProfile
(String profileName) Disable thefetch profile
with the given name in this session.doList()
protected abstract ScrollableResultsImplementor<R>
doScroll
(ScrollMode scrollMode) enableFetchProfile
(String profileName) Enable thefetch profile
for this query.Obtain theCacheMode
in effect for this query.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).The callback referenceObtain the JDBC fetch size hint in effect for this query.The JPAFlushModeType
in effect for this query.Get the root LockMode for the queryGet the rootLockModeType
for the queryTheLockOptions
currently in effect for the queryprotected abstract String
Execute the query and return the query results as aStream
.Execute the query and return the single result of the query, throwing an exception if the query returns no results.Execute the query and return the single result of the query, ornull
if the query returns no results.boolean
boolean
Should the results of the query be stored in the second level cache?boolean
Should the query plan of the query be stored in the query plan cache?boolean
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()
Execute the query and return the query results as aList
.protected abstract void
protected boolean
requiresTxn
(LockMode lockMode) protected void
scroll()
Returns scrollable access to the query results.scroll
(ScrollMode scrollMode) Returns scrollable access to the query results.setAliasSpecificLockMode
(String alias, LockMode lockMode) Deprecated.setCacheable
(boolean cacheable) Enable/disable second level query (result) caching for this query.setCacheMode
(CacheMode cacheMode) Set the currentCacheMode
in effect for this query.setCacheRegion
(String regionName) Set the name of the cache region where query results should be cached (assumingSelectionQuery.isCacheable()
).setCacheRetrieveMode
(CacheRetrieveMode cacheRetrieveMode) setCacheStoreMode
(CacheStoreMode cacheStoreMode) setComment
(String comment) Set a comment for this query.setEntityGraph
(EntityGraph<R> graph, GraphSemantic semantic) Apply anEntityGraph
to the query.setFetchSize
(int fetchSize) Sets a JDBC fetch size hint for the query.setFirstResult
(int startPosition) Set the first row position to return from the query results.setFlushMode
(FlushModeType flushMode) Set theFlushMode
in to use for this query.setFollowOnLocking
(boolean enable) Specifies whether follow-on locking should be applied?setHibernateFlushMode
(FlushMode flushMode) Set the currentFlushMode
in effect for this query.setHibernateLockMode
(LockMode lockMode) Specify the root LockMode for the querySet a hint.setLockMode
(LockModeType lockMode) Specify the root LockModeType for the querysetLockMode
(String alias, LockMode lockMode) Specify aLockMode
to apply to a specific alias defined in the querysetMaxResults
(int maxResult) Set the max number of rows requested for the query results.setParameter
(int position, Object value) Bind the given argument to an ordinal query parameter.setParameter
(int position, Instant value, TemporalType temporalType) Bind anInstant
to an ordinal query parameter using just the portion indicated by the givenTemporalType
.setParameter
(int position, Calendar value, TemporalType temporalType) 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
.setParameter
(Parameter<Calendar> param, Calendar value, TemporalType temporalType) setParameter
(Parameter<Date> param, Date value, TemporalType temporalType) <P> SelectionQuery<R>
setParameter
(Parameter<P> parameter, P value) setParameter
(String name, Object value) Bind the given argument to a named query parameter.setParameter
(String name, Instant value, TemporalType temporalType) Bind anInstant
to the named query parameter using just the portion indicated by the givenTemporalType
.setParameter
(String name, Calendar value, TemporalType temporalType) 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
.setParameterList
(int position, Object[] values) Bind multiple arguments to an ordinal query parameter.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
.setParameterList
(String name, Object[] values) Bind multiple arguments to a named query parameter.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
.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.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.setQueryPlanCacheable
(boolean queryPlanCacheable) Enable/disable query plan caching for this query.setReadOnly
(boolean readOnly) Set the read-only/modifiable mode for entities and proxies loaded by thisQuery
.setTimeout
(int timeout) Set the query timeout in seconds.stream()
Execute the query and return the query results as aStream
.protected static <T> T
uniqueElement
(List<T> list) Execute the query and return the single result of the query, ornull
if the query returns no results.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 Details
-
CRITERIA_HQL_STRING
The value used forgetQueryString()
for Criteria-based queries- See Also:
-
-
Constructor Details
-
Method Details
-
applyOptions
-
getQueryString
-
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
-
beforeQueryHandlingFetchProfiles
-
beforeQuery
protected void beforeQuery() -
prepareForExecution
protected abstract void prepareForExecution() -
afterQueryHandlingFetchProfiles
-
afterQuery
protected void afterQuery(boolean success) -
afterQuery
protected void afterQuery() -
requiresTxn
-
doList
-
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
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
-
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
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
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
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
- Throws:
NonUniqueResultException
-
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
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
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
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:
-
setFlushMode
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:
-
setMaxResults
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
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
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:
-
setEntityGraph
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
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:
-
disableFetchProfile
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:
-
getLockOptions
Description copied from interface:SelectionQuery
TheLockOptions
currently in effect for the query- Specified by:
getLockOptions
in interfaceSelectionQuery<R>
-
getLockMode
Description copied from interface:SelectionQuery
Get the rootLockModeType
for the query- Specified by:
getLockMode
in interfaceSelectionQuery<R>
- See Also:
-
setLockMode
Specify the root LockModeType for the query- Specified by:
setLockMode
in interfaceSelectionQuery<R>
- See Also:
-
setLockMode
Description copied from interface:SelectionQuery
Specify aLockMode
to apply to a specific alias defined in the query- Specified by:
setLockMode
in interfaceSelectionQuery<R>
-
getHibernateLockMode
Get the root LockMode for the query- Specified by:
getHibernateLockMode
in interfaceSelectionQuery<R>
- See Also:
-
setHibernateLockMode
Specify the root LockMode for the query- Specified by:
setHibernateLockMode
in interfaceSelectionQuery<R>
- See Also:
-
setAliasSpecificLockMode
Deprecated.Specify a LockMode to apply to a specific alias defined in the query- Specified by:
setAliasSpecificLockMode
in interfaceSelectionQuery<R>
-
setFollowOnLocking
Specifies whether follow-on locking should be applied?- Specified by:
setFollowOnLocking
in interfaceSelectionQuery<R>
-
collectHints
- Overrides:
collectHints
in classAbstractCommonQueryContract
-
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:
-
setFetchSize
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:
-
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:
-
setReadOnly
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
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:
-
getCacheStoreMode
- Specified by:
getCacheStoreMode
in interfaceSelectionQuery<R>
- See Also:
-
getCacheRetrieveMode
- Specified by:
getCacheRetrieveMode
in interfaceSelectionQuery<R>
- See Also:
-
setCacheMode
Description copied from interface:SelectionQuery
Set the currentCacheMode
in effect for this query.- Specified by:
setCacheMode
in interfaceSelectionQuery<R>
- See Also:
-
setCacheRetrieveMode
- Specified by:
setCacheRetrieveMode
in interfaceSelectionQuery<R>
- See Also:
-
setCacheStoreMode
- Specified by:
setCacheStoreMode
in interfaceSelectionQuery<R>
- See Also:
-
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
Description copied from interface:SelectionQuery
Enable/disable second level query (result) caching for this query.- Specified by:
setCacheable
in interfaceSelectionQuery<R>
- See Also:
-
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
Description copied from interface:SelectionQuery
Enable/disable query plan caching for this query.- Specified by:
setQueryPlanCacheable
in interfaceSelectionQuery<R>
- See Also:
-
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
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:
-
setHibernateFlushMode
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:
-
setTimeout
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:
-
setComment
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:
-
setParameter
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:
-
setParameter
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:
-
setParameter
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
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
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:
-
setParameter
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:
-
setParameter
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
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
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:
-
setParameter
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:
-
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
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
-
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:
-
setParameter
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
-
setParameter
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
-
setParameter
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
-
setParameter
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
-
setParameter
- Specified by:
setParameter
in interfaceCommonQueryContract
- Specified by:
setParameter
in interfaceSelectionQuery<R>
- Overrides:
setParameter
in classAbstractCommonQueryContract
- See Also:
-
setParameterList
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:
-
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:
-
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
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
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:
-
setParameterList
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
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:
-
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
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
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:
-
setParameterList
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:
-
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
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:
-
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
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
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
-
setLockMode(String, LockMode)
}