Class DelegatingSqmSelectionQueryImplementor<R>
- java.lang.Object
-
- org.hibernate.query.sqm.spi.DelegatingSqmSelectionQueryImplementor<R>
-
- All Implemented Interfaces:
CommonQueryContract,SelectionQuery<R>,SqmQuery,SqmSelectionQueryImplementor<R>,SqmSelectionQuery<R>
@Incubating public abstract class DelegatingSqmSelectionQueryImplementor<R> extends Object implements SqmSelectionQueryImplementor<R>
-
-
Constructor Summary
Constructors Constructor Description DelegatingSqmSelectionQueryImplementor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SqmSelectionQueryImplementor<R>disableFetchProfile(String profileName)Disable thefetch profilewith the given name in this session.SqmSelectionQueryImplementor<R>enableFetchProfile(String profileName)Enable thefetch profilefor this query.<T> TexecuteQuery(ResultsConsumer<T,R> resultsConsumer)CacheModegetCacheMode()Obtain theCacheModein effect for this query.StringgetCacheRegion()Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion onSelectionQuery.isCacheable()for more information).CacheRetrieveModegetCacheRetrieveMode()CacheStoreModegetCacheStoreMode()StringgetComment()Get the comment that has been set for this query, if any.protected abstract SqmSelectionQueryImplementor<R>getDelegate()IntegergetFetchSize()Obtain the JDBC fetch size hint in effect for this query.intgetFirstResult()The first row position to return from the query results.FlushModeTypegetFlushMode()The JPAFlushModeTypein effect for this query.FlushModegetHibernateFlushMode()TheFlushModein effect for this query.LockModegetHibernateLockMode()Get the rootLockModefor the queryKeyedResultList<R>getKeyedResultList(KeyedPage<R> page)Execute the query and return the results for the given page, using key-based pagination.LockModeTypegetLockMode()Get the rootLockModeTypefor the queryLockOptionsgetLockOptions()TheLockOptionscurrently in effect for the queryintgetMaxResults()The max number of rows requested for the query resultsParameterMetadatagetParameterMetadata()QueryOptionsgetQueryOptions()StringgetQueryString()longgetResultCount()Determine the size of the query result list that would be returned by callingSelectionQuery.getResultList()with no offset or limit applied to the query.List<R>getResultList()Execute the query and return the query results as aList.Stream<R>getResultStream()Execute the query and return the query results as aStream.RgetSingleResult()Execute the query and return the single result of the query, throwing an exception if the query returns no results.RgetSingleResultOrNull()Execute the query and return the single result of the query, ornullif the query returns no results.SqmStatementgetSqmStatement()IntegergetTimeout()Obtain the query timeout in seconds.booleanisCacheable()Should the results of the query be stored in the second level cache?booleanisQueryPlanCacheable()Should the query plan of the query be stored in the query plan cache?booleanisReadOnly()Should entities and proxies loaded by this Query be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context i s returned instead.List<R>list()Execute the query and return the query results as aList.ScrollableResults<R>scroll()Returns scrollable access to the query results.ScrollableResults<R>scroll(ScrollMode scrollMode)Returns scrollable access to the query results.@Remove SqmSelectionQueryImplementor<R>setAliasSpecificLockMode(String alias, LockMode lockMode)Deprecated.SqmSelectionQueryImplementor<R>setCacheable(boolean cacheable)Enable/disable second level query (result) caching for this query.SqmSelectionQueryImplementor<R>setCacheMode(CacheMode cacheMode)Set the currentCacheModein effect for this query.SqmSelectionQueryImplementor<R>setCacheRegion(String cacheRegion)Set the name of the cache region where query results should be cached (assumingSelectionQuery.isCacheable()).SqmSelectionQueryImplementor<R>setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode)SqmSelectionQueryImplementor<R>setCacheStoreMode(CacheStoreMode cacheStoreMode)SqmSelectionQueryImplementor<R>setComment(String comment)Set a comment for this query.SqmSelectionQueryImplementor<R>setEntityGraph(EntityGraph<R> graph, GraphSemantic semantic)Apply anEntityGraphto the query.SqmSelectionQueryImplementor<R>setFetchSize(int fetchSize)Sets a JDBC fetch size hint for the query.SqmSelectionQueryImplementor<R>setFirstResult(int startPosition)Set the first row position to return from the query results.SqmSelectionQueryImplementor<R>setFlushMode(FlushModeType flushMode)Set theFlushModein to use for this query.SqmSelectionQueryImplementor<R>setFollowOnLocking(boolean enable)Specifies whether follow-on locking should be appliedSqmSelectionQueryImplementor<R>setHibernateFlushMode(FlushMode flushMode)Set the currentFlushModein effect for this query.SqmSelectionQueryImplementor<R>setHibernateLockMode(LockMode lockMode)Specify the rootLockModefor the querySqmSelectionQueryImplementor<R>setHint(String hintName, Object value)Set a hint.SqmSelectionQueryImplementor<R>setLockMode(LockModeType lockMode)Specify the rootLockModeTypefor the querySqmSelectionQueryImplementor<R>setLockMode(String alias, LockMode lockMode)Specify aLockModeto apply to a specific alias defined in the querySqmSelectionQueryImplementor<R>setMaxResults(int maxResult)Set the max number of rows requested for the query results.SqmSelectionQueryImplementor<R>setOrder(List<Order<? super R>> orders)If the result type of this query is an entity class, add one or more rules for ordering the query results.SqmSelectionQueryImplementor<R>setOrder(Order<? super R> order)If the result type of this query is an entity class, add a rule for ordering the query results.SqmSelectionQueryImplementor<R>setPage(Page page)Set the page of results to return.SqmSelectionQueryImplementor<R>setParameter(int position, Object value)Bind the given argument to an ordinal query parameter.SqmSelectionQueryImplementor<R>setParameter(int position, Instant value, TemporalType temporalType)Bind anInstantto an ordinal query parameter using just the portion indicated by the givenTemporalType.SqmSelectionQueryImplementor<R>setParameter(int position, Calendar value, TemporalType temporalType)SqmSelectionQueryImplementor<R>setParameter(int position, Date value, TemporalType temporalType)<P> SqmSelectionQueryImplementor<R>setParameter(int position, P value, Class<P> type)Bind the given argument to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType.<P> SqmSelectionQueryImplementor<R>setParameter(int position, P value, BindableType<P> type)Bind the given argument to an ordinal query parameter using the givenBindableType.SqmSelectionQueryImplementor<R>setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)SqmSelectionQueryImplementor<R>setParameter(Parameter<Date> param, Date value, TemporalType temporalType)<T> SqmSelectionQueryImplementor<R>setParameter(Parameter<T> param, T value)SqmSelectionQueryImplementor<R>setParameter(String name, Object value)Bind the given argument to a named query parameter.SqmSelectionQueryImplementor<R>setParameter(String name, Instant value, TemporalType temporalType)Bind anInstantto the named query parameter using just the portion indicated by the givenTemporalType.SqmSelectionQueryImplementor<R>setParameter(String name, Calendar value, TemporalType temporalType)SqmSelectionQueryImplementor<R>setParameter(String name, Date value, TemporalType temporalType)<P> SqmSelectionQueryImplementor<R>setParameter(String name, P value, Class<P> type)Bind the given argument to a named query parameter using the givenClassreference to attempt to infer theBindableType.<P> SqmSelectionQueryImplementor<R>setParameter(String name, P value, BindableType<P> type)Bind the given argument to a named query parameter using the givenBindableType.<P> SqmSelectionQueryImplementor<R>setParameter(QueryParameter<P> parameter, P value, Class<P> type)Bind an argument to the query parameter represented by the givenQueryParameter, using the givenClassreference to attempt to infer theBindableTypeto use.<P> SqmSelectionQueryImplementor<R>setParameter(QueryParameter<P> parameter, P val, BindableType<P> type)Bind an argument to the query parameter represented by the givenQueryParameter, using the givenBindableType.<T> SqmSelectionQueryImplementor<R>setParameter(QueryParameter<T> parameter, T value)Bind an argument to the query parameter represented by the givenQueryParameter.SqmSelectionQueryImplementor<R>setParameterList(int position, Object[] values)Bind multiple arguments to an ordinal query parameter.SqmSelectionQueryImplementor<R>setParameterList(int position, Collection values)Bind multiple arguments to an ordinal query parameter.<P> SqmSelectionQueryImplementor<R>setParameterList(int position, Collection<? extends P> values, Class<P> javaType)Bind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType.<P> SqmSelectionQueryImplementor<R>setParameterList(int position, Collection<? extends P> values, BindableType<P> type)Bind multiple arguments to an ordinal query parameter using the givenBindableType.<P> SqmSelectionQueryImplementor<R>setParameterList(int position, P[] values, Class<P> javaType)Bind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType.<P> SqmSelectionQueryImplementor<R>setParameterList(int position, P[] values, BindableType<P> type)Bind multiple arguments to an ordinal query parameter using the givenBindableType.SqmSelectionQueryImplementor<R>setParameterList(String name, Object[] values)Bind multiple arguments to a named query parameter.SqmSelectionQueryImplementor<R>setParameterList(String name, Collection values)Bind multiple arguments to a named query parameter.<P> SqmSelectionQueryImplementor<R>setParameterList(String name, Collection<? extends P> values, Class<P> javaType)Bind multiple arguments to a named query parameter using the givenClassreference to attempt to infer theBindableTypeIf unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameterList(String, Collection).<P> SqmSelectionQueryImplementor<R>setParameterList(String name, Collection<? extends P> values, BindableType<P> type)Bind multiple arguments to a named query parameter using the givenBindableType.<P> SqmSelectionQueryImplementor<R>setParameterList(String name, P[] values, Class<P> javaType)Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine theBindableTypeto use.<P> SqmSelectionQueryImplementor<R>setParameterList(String name, P[] values, BindableType<P> type)Bind multiple arguments to a named query parameter using the givenBindableType.<P> SqmSelectionQueryImplementor<R>setParameterList(QueryParameter<P> parameter, Collection<? extends P> values)Bind multiple arguments to the query parameter represented by the givenQueryParameter.<P> SqmSelectionQueryImplementor<R>setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType)Bind multiple arguments to the query parameter represented by the givenQueryParameterusing the givenClassreference to attempt to infer theBindableTypeto use.<P> SqmSelectionQueryImplementor<R>setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type)Bind multiple arguments to the query parameter represented by the givenQueryParameter, using the givenBindableType.<P> SqmSelectionQueryImplementor<R>setParameterList(QueryParameter<P> parameter, P[] values)Bind multiple arguments to the query parameter represented by the givenQueryParameter.<P> SqmSelectionQueryImplementor<R>setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType)Bind multiple arguments to the query parameter represented by the givenQueryParameterusing the givenClassreference to attempt to infer theBindableTypeto use.<P> SqmSelectionQueryImplementor<R>setParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)Bind multiple arguments to the query parameter represented by the givenQueryParameter, using the given theBindableType.SqmSelectionQueryImplementor<R>setProperties(Object bean)Bind the property values of the given bean to named parameters of the query, matching property names with parameter names and mapping property types to Hibernate types using heuristics.SqmSelectionQueryImplementor<R>setProperties(Map bean)Bind the values of the givenMapto named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.SqmSelectionQueryImplementor<R>setQueryPlanCacheable(boolean queryPlanCacheable)Enable/disable query plan caching for this query.SqmSelectionQueryImplementor<R>setReadOnly(boolean readOnly)Set the read-only/modifiable mode for entities and proxies loaded by thisQuery.SqmSelectionQueryImplementor<R>setTimeout(int timeout)Set the query timeout in seconds.Stream<R>stream()Execute the query and return the query results as aStream.RuniqueResult()Execute the query and return the single result of the query, ornullif the query returns no results.Optional<R>uniqueResultOptional()Execute the query and return the single result of the query, as anOptional.
-
-
-
Method Detail
-
getDelegate
protected abstract SqmSelectionQueryImplementor<R> getDelegate()
-
getFlushMode
public FlushModeType getFlushMode()
Description copied from interface:CommonQueryContractThe JPAFlushModeTypein effect for this query. By default, the query inherits theFlushModeof theSessionfrom which it originates.- Specified by:
getFlushModein interfaceCommonQueryContract- See Also:
CommonQueryContract.getHibernateFlushMode(),Session.getHibernateFlushMode()
-
setFlushMode
public SqmSelectionQueryImplementor<R> setFlushMode(FlushModeType flushMode)
Description copied from interface:CommonQueryContractSet theFlushModein to use for this query.- Specified by:
setFlushModein interfaceCommonQueryContract- Specified by:
setFlushModein interfaceSelectionQuery<R>- See Also:
CommonQueryContract.getHibernateFlushMode(),Session.getHibernateFlushMode()
-
getHibernateFlushMode
public FlushMode getHibernateFlushMode()
Description copied from interface:CommonQueryContractTheFlushModein effect for this query. By default, the query inherits theFlushModeof theSessionfrom which it originates.- Specified by:
getHibernateFlushModein interfaceCommonQueryContract- See Also:
Session.getHibernateFlushMode()
-
getTimeout
public Integer getTimeout()
Description copied from interface:CommonQueryContractObtain the query timeout in seconds.This value is eventually passed along to the JDBC statement via
Statement.setQueryTimeout(int).A value of zero indicates no timeout.
- Specified by:
getTimeoutin interfaceCommonQueryContract- See Also:
Statement.getQueryTimeout(),Statement.setQueryTimeout(int)
-
getComment
public String getComment()
Description copied from interface:CommonQueryContractGet the comment that has been set for this query, if any.- Specified by:
getCommentin interfaceCommonQueryContract
-
setComment
public SqmSelectionQueryImplementor<R> setComment(String comment)
Description copied from interface:CommonQueryContractSet a comment for this query.- Specified by:
setCommentin interfaceCommonQueryContract- Specified by:
setCommentin interfaceSelectionQuery<R>- See Also:
Query.setComment(String)
-
setHint
public SqmSelectionQueryImplementor<R> setHint(String hintName, Object value)
Description copied from interface:CommonQueryContractSet a hint. The hints understood by Hibernate are enumerated byAvailableHints.- Specified by:
setHintin interfaceCommonQueryContract- Specified by:
setHintin interfaceSelectionQuery<R>- See Also:
HibernateHints,SpecHints
-
list
public List<R> list()
Description copied from interface:SelectionQueryExecute 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:
listin interfaceSelectionQuery<R>- Returns:
- the result list
-
getResultList
public List<R> getResultList()
Description copied from interface:SelectionQueryExecute 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:
getResultListin interfaceSelectionQuery<R>- Returns:
- the results as a list
-
getResultCount
public long getResultCount()
Description copied from interface:SelectionQueryDetermine the size of the query result list that would be returned by callingSelectionQuery.getResultList()with no offset or limit applied to the query.- Specified by:
getResultCountin interfaceSelectionQuery<R>- Returns:
- the size of the list that would be returned
-
getKeyedResultList
public KeyedResultList<R> getKeyedResultList(KeyedPage<R> page)
Description copied from interface:SelectionQueryExecute the query and return the results for the given page, using key-based pagination.- Specified by:
getKeyedResultListin interfaceSelectionQuery<R>- Parameters:
page- the key-based specification of the page as an instance ofKeyedPage- Returns:
- the query results and the key of the next page
as an instance of
KeyedResultList - See Also:
KeyedPage,KeyedResultList
-
scroll
public ScrollableResults<R> scroll()
Description copied from interface:SelectionQueryReturns scrollable access to the query results.This form calls
SelectionQuery.scroll(ScrollMode)usingDialect.defaultScrollMode()- Specified by:
scrollin interfaceSelectionQuery<R>
-
scroll
public ScrollableResults<R> scroll(ScrollMode scrollMode)
Description copied from interface:SelectionQueryReturns scrollable access to the query results. The capabilities of the returned ScrollableResults depend on the specified ScrollMode.- Specified by:
scrollin interfaceSelectionQuery<R>
-
getResultStream
public Stream<R> getResultStream()
Description copied from interface:SelectionQueryExecute 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:
getResultStreamin interfaceSelectionQuery<R>- Returns:
- The results as a
Stream
-
stream
public Stream<R> stream()
Description copied from interface:SelectionQueryExecute 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:
streamin interfaceSelectionQuery<R>- Returns:
- The results as a
Stream
-
uniqueResult
public R uniqueResult()
Description copied from interface:SelectionQueryExecute the query and return the single result of the query, ornullif the query returns no results.- Specified by:
uniqueResultin interfaceSelectionQuery<R>- Returns:
- the single result or
null
-
getSingleResult
public R getSingleResult()
Description copied from interface:SelectionQueryExecute the query and return the single result of the query, throwing an exception if the query returns no results.- Specified by:
getSingleResultin interfaceSelectionQuery<R>- Returns:
- the single result, only if there is exactly one
-
getSingleResultOrNull
public R getSingleResultOrNull()
Description copied from interface:SelectionQueryExecute the query and return the single result of the query, ornullif the query returns no results.- Specified by:
getSingleResultOrNullin interfaceSelectionQuery<R>- Returns:
- the single result or
nullif there is no result to return
-
uniqueResultOptional
public Optional<R> uniqueResultOptional()
Description copied from interface:SelectionQueryExecute the query and return the single result of the query, as anOptional.- Specified by:
uniqueResultOptionalin interfaceSelectionQuery<R>- Returns:
- the single result as an
Optional
-
setEntityGraph
public SqmSelectionQueryImplementor<R> setEntityGraph(EntityGraph<R> graph, GraphSemantic semantic)
Description copied from interface:SelectionQueryApply anEntityGraphto the query.This is an alternative way to specify the associations which should be fetched as part of the initial query.
- Specified by:
setEntityGraphin interfaceSelectionQuery<R>
-
enableFetchProfile
public SqmSelectionQueryImplementor<R> enableFetchProfile(String profileName)
Description copied from interface:SelectionQueryEnable thefetch profilefor 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:
enableFetchProfilein interfaceSelectionQuery<R>- Parameters:
profileName- the name of the fetch profile to be enabled- See Also:
FetchProfile
-
disableFetchProfile
public SqmSelectionQueryImplementor<R> disableFetchProfile(String profileName)
Description copied from interface:SelectionQueryDisable thefetch profilewith the given name in this session. If the requested fetch profile is not currently enabled, the call has no effect.- Specified by:
disableFetchProfilein interfaceSelectionQuery<R>- Parameters:
profileName- the name of the fetch profile to be disabled- See Also:
FetchProfile
-
getFetchSize
public Integer getFetchSize()
Description copied from interface:SelectionQueryObtain 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:
getFetchSizein interfaceSelectionQuery<R>- Returns:
- The timeout in seconds
- See Also:
Statement.getFetchSize(),Statement.setFetchSize(int)
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:SelectionQueryShould 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:
isReadOnlyin interfaceSelectionQuery<R>- Returns:
trueif the entities and proxies loaded by the query will be put in read-only mode;falseotherwise (they will be modifiable)- See Also:
SelectionQuery.setReadOnly(boolean),The read-only/modifiable setting has no impact on entities/proxies returned by the query that existed in the session beforeQuery the query was executed.
-
getMaxResults
public int getMaxResults()
Description copied from interface:SelectionQueryThe max number of rows requested for the query results- Specified by:
getMaxResultsin interfaceSelectionQuery<R>
-
setMaxResults
public SqmSelectionQueryImplementor<R> setMaxResults(int maxResult)
Description copied from interface:SelectionQuerySet the max number of rows requested for the query results. Applied to the SQL query- Specified by:
setMaxResultsin interfaceSelectionQuery<R>
-
getFirstResult
public int getFirstResult()
Description copied from interface:SelectionQueryThe first row position to return from the query results. Applied to the SQL query.- Specified by:
getFirstResultin interfaceSelectionQuery<R>
-
setFirstResult
public SqmSelectionQueryImplementor<R> setFirstResult(int startPosition)
Description copied from interface:SelectionQuerySet the first row position to return from the query results. Applied to the SQL query.- Specified by:
setFirstResultin interfaceSelectionQuery<R>
-
setPage
@Incubating public SqmSelectionQueryImplementor<R> setPage(Page page)
Description copied from interface:SelectionQuerySet the page of results to return.- Specified by:
setPagein interfaceSelectionQuery<R>- See Also:
Page
-
getCacheMode
public CacheMode getCacheMode()
Description copied from interface:SelectionQueryObtain theCacheModein effect for this query. By default, the query inherits theCacheModeof the session from which it originates.The
CacheModehere 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:
getCacheModein interfaceSelectionQuery<R>- See Also:
Session.getCacheMode()
-
getCacheStoreMode
public CacheStoreMode getCacheStoreMode()
- Specified by:
getCacheStoreModein interfaceSelectionQuery<R>- See Also:
SelectionQuery.getCacheMode()
-
getCacheRetrieveMode
public CacheRetrieveMode getCacheRetrieveMode()
- Specified by:
getCacheRetrieveModein interfaceSelectionQuery<R>- See Also:
SelectionQuery.getCacheMode()
-
setCacheStoreMode
public SqmSelectionQueryImplementor<R> setCacheStoreMode(CacheStoreMode cacheStoreMode)
- Specified by:
setCacheStoreModein interfaceSelectionQuery<R>- See Also:
SelectionQuery.setCacheMode(CacheMode)
-
setCacheRetrieveMode
public SqmSelectionQueryImplementor<R> setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode)
- Specified by:
setCacheRetrieveModein interfaceSelectionQuery<R>- See Also:
SelectionQuery.setCacheMode(CacheMode)
-
isCacheable
public boolean isCacheable()
Description copied from interface:SelectionQueryShould 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
SessionFactoryfor this to happen. Usually that is controlled by the configuration setting "hibernate.cache.use_query_cache".- Specified by:
isCacheablein interfaceSelectionQuery<R>
-
isQueryPlanCacheable
public boolean isQueryPlanCacheable()
Description copied from interface:SelectionQueryShould the query plan of the query be stored in the query plan cache?- Specified by:
isQueryPlanCacheablein interfaceSelectionQuery<R>
-
setQueryPlanCacheable
public SqmSelectionQueryImplementor<R> setQueryPlanCacheable(boolean queryPlanCacheable)
Description copied from interface:SelectionQueryEnable/disable query plan caching for this query.- Specified by:
setQueryPlanCacheablein interfaceSelectionQuery<R>- See Also:
SelectionQuery.isQueryPlanCacheable()
-
getCacheRegion
public String getCacheRegion()
Description copied from interface:SelectionQueryObtain 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).nullindicates that the default region should be used.- Specified by:
getCacheRegionin interfaceSelectionQuery<R>
-
getLockOptions
public LockOptions getLockOptions()
Description copied from interface:SelectionQueryTheLockOptionscurrently in effect for the query- Specified by:
getLockOptionsin interfaceSelectionQuery<R>
-
getLockMode
public LockModeType getLockMode()
Description copied from interface:SelectionQueryGet the rootLockModeTypefor the query- Specified by:
getLockModein interfaceSelectionQuery<R>- See Also:
SelectionQuery.getHibernateLockMode()
-
setLockMode
public SqmSelectionQueryImplementor<R> setLockMode(LockModeType lockMode)
Description copied from interface:SelectionQuerySpecify the rootLockModeTypefor the query- Specified by:
setLockModein interfaceSelectionQuery<R>- See Also:
SelectionQuery.setHibernateLockMode(org.hibernate.LockMode)
-
getHibernateLockMode
public LockMode getHibernateLockMode()
Description copied from interface:SelectionQueryGet the rootLockModefor the query- Specified by:
getHibernateLockModein interfaceSelectionQuery<R>- See Also:
SelectionQuery.getLockMode()
-
setHibernateLockMode
public SqmSelectionQueryImplementor<R> setHibernateLockMode(LockMode lockMode)
Description copied from interface:SelectionQuerySpecify the rootLockModefor the query- Specified by:
setHibernateLockModein interfaceSelectionQuery<R>- See Also:
SelectionQuery.setLockMode(LockModeType)
-
setLockMode
public SqmSelectionQueryImplementor<R> setLockMode(String alias, LockMode lockMode)
Description copied from interface:SelectionQuerySpecify aLockModeto apply to a specific alias defined in the query- Specified by:
setLockModein interfaceSelectionQuery<R>
-
setOrder
@Incubating public SqmSelectionQueryImplementor<R> setOrder(List<Order<? super R>> orders)
Description copied from interface:SelectionQueryIf the result type of this query is an entity class, add one or more rules for ordering the query results.- Specified by:
setOrderin interfaceSelectionQuery<R>- Parameters:
orders- one or more instances ofOrder- See Also:
Order
-
setOrder
@Incubating public SqmSelectionQueryImplementor<R> setOrder(Order<? super R> order)
Description copied from interface:SelectionQueryIf the result type of this query is an entity class, add a rule for ordering the query results.- Specified by:
setOrderin interfaceSelectionQuery<R>- Parameters:
order- an instance ofOrder- See Also:
Order
-
setAliasSpecificLockMode
@Remove @Deprecated(since="6.2") public @Remove SqmSelectionQueryImplementor<R> setAliasSpecificLockMode(String alias, LockMode lockMode)
Deprecated.Description copied from interface:SelectionQuerySpecify aLockModeto apply to a specific alias defined in the query- Specified by:
setAliasSpecificLockModein interfaceSelectionQuery<R>
-
setFollowOnLocking
public SqmSelectionQueryImplementor<R> setFollowOnLocking(boolean enable)
Description copied from interface:SelectionQuerySpecifies whether follow-on locking should be applied- Specified by:
setFollowOnLockingin interfaceSelectionQuery<R>
-
getQueryString
public String getQueryString()
- Specified by:
getQueryStringin interfaceSqmQuery
-
getSqmStatement
public SqmStatement getSqmStatement()
- Specified by:
getSqmStatementin interfaceSqmQuery
-
getParameterMetadata
public ParameterMetadata getParameterMetadata()
- Specified by:
getParameterMetadatain interfaceSqmQuery
-
getQueryOptions
public QueryOptions getQueryOptions()
- Specified by:
getQueryOptionsin interfaceSqmQuery
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(String name, Object value)
Description copied from interface:CommonQueryContractBind 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:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
CommonQueryContract.setParameter(String, Object, Class),CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(String name, P value, Class<P> type)
Description copied from interface:CommonQueryContractBind the given argument to a named query parameter using the givenClassreference to attempt to infer theBindableType. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameter(String, Object).- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(String name, P value, BindableType<P> type)
Description copied from interface:CommonQueryContractBind the given argument to a named query parameter using the givenBindableType.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(String name, Instant value, TemporalType temporalType)
Description copied from interface:CommonQueryContractBind anInstantto the named query parameter using just the portion indicated by the givenTemporalType.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(String name, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
Query.setParameter(String, Calendar, TemporalType)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(String name, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
Query.setParameter(String, Date, TemporalType)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(int position, Object value)
Description copied from interface:CommonQueryContractBind 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:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
CommonQueryContract.setParameter(int, Object, Class),CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(int position, P value, Class<P> type)
Description copied from interface:CommonQueryContractBind the given argument to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameter(int, Object).- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(int position, P value, BindableType<P> type)
Description copied from interface:CommonQueryContractBind the given argument to an ordinal query parameter using the givenBindableType.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(int position, Instant value, TemporalType temporalType)
Description copied from interface:CommonQueryContractBind anInstantto an ordinal query parameter using just the portion indicated by the givenTemporalType.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(int position, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
Query.setParameter(int, Date, TemporalType)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(int position, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
Query.setParameter(int, Calendar, TemporalType)
-
setParameter
public <T> SqmSelectionQueryImplementor<R> setParameter(QueryParameter<T> parameter, T value)
Description copied from interface:CommonQueryContractBind 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:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- Parameters:
parameter- the query parameter mementovalue- the argument, which might be null- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(QueryParameter<P> parameter, P value, Class<P> type)
Description copied from interface:CommonQueryContractBind an argument to the query parameter represented by the givenQueryParameter, using the givenClassreference to attempt to infer theBindableTypeto use. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameter(QueryParameter, Object).- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- Parameters:
parameter- the query parameter mementovalue- the argument, which might be nulltype- aBindableTyperepresenting the type of the parameter- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
public <P> SqmSelectionQueryImplementor<R> setParameter(QueryParameter<P> parameter, P val, BindableType<P> type)
Description copied from interface:CommonQueryContractBind an argument to the query parameter represented by the givenQueryParameter, using the givenBindableType.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- Parameters:
parameter- the query parameter mementoval- the argument, which might be nulltype- aBindableTyperepresenting the type of the parameter- Returns:
this, for method chaining
-
setParameter
public <T> SqmSelectionQueryImplementor<R> setParameter(Parameter<T> param, T value)
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
Query.setParameter(Parameter, Object)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
Query.setParameter(Parameter, Calendar, TemporalType)
-
setParameter
public SqmSelectionQueryImplementor<R> setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceSelectionQuery<R>- Specified by:
setParameterin interfaceSqmQuery- Specified by:
setParameterin interfaceSqmSelectionQuery<R>- See Also:
Query.setParameter(Parameter, Date, TemporalType)
-
setParameterList
public SqmSelectionQueryImplementor<R> setParameterList(String name, Collection values)
Description copied from interface:CommonQueryContractBind 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:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, java.util.Collection, BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(String name, Collection<? extends P> values, Class<P> javaType)
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the givenClassreference to attempt to infer theBindableTypeIf unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, java.util.Collection, BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(String name, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setParameterList
public SqmSelectionQueryImplementor<R> setParameterList(String name, Object[] values)
Description copied from interface:CommonQueryContractBind 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:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(String name, P[] values, Class<P> javaType)
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the given Class reference to attempt to determine theBindableTypeto use. If unable to determine an appropriateBindableType,CommonQueryContract.setParameterList(String, Collection)is used- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, Object[], BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(String name, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setParameterList
public SqmSelectionQueryImplementor<R> setParameterList(int position, Collection values)
Description copied from interface:CommonQueryContractBind 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:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(int position, Collection<? extends P> values, Class<P> javaType)
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(int, Collection, BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(int position, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setParameterList
public SqmSelectionQueryImplementor<R> setParameterList(int position, Object[] values)
Description copied from interface:CommonQueryContractBind 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:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(int position, P[] values, Class<P> javaType)
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(int, Object[], BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(int position, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> values)
Description copied from interface:CommonQueryContractBind 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:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Parameters:
parameter- the parameter mementovalues- a collection of arguments- Returns:
this, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType)
Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameterusing the givenClassreference to attempt to infer theBindableTypeto use. If unable to infer an appropriateBindableType, fall back to usingCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(QueryParameter, java.util.Collection, BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameter, using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, P[] values)
Description copied from interface:CommonQueryContractBind 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
QueryParameterand the type of the first given argument.- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Parameters:
parameter- the parameter mementovalues- a collection of arguments- Returns:
this, for method chaining
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType)
Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameterusing the givenClassreference to attempt to infer theBindableTypeto use. If unable to infer an appropriateBindableType, fall back to usingCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(QueryParameter, Object[], BindableType)
-
setParameterList
public <P> SqmSelectionQueryImplementor<R> setParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameter, using the given theBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Specified by:
setParameterListin interfaceSelectionQuery<R>- Specified by:
setParameterListin interfaceSqmQuery- Specified by:
setParameterListin interfaceSqmSelectionQuery<R>- Returns:
this, for method chaining
-
setProperties
public SqmSelectionQueryImplementor<R> setProperties(Object bean)
Description copied from interface:CommonQueryContractBind 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:
setPropertiesin interfaceCommonQueryContract- Specified by:
setPropertiesin interfaceSelectionQuery<R>- Specified by:
setPropertiesin interfaceSqmQuery- Specified by:
setPropertiesin interfaceSqmSelectionQuery<R>- Parameters:
bean- any JavaBean or POJO- Returns:
this, for method chaining
-
setProperties
public SqmSelectionQueryImplementor<R> setProperties(Map bean)
Description copied from interface:CommonQueryContractBind the values of the givenMapto named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.- Specified by:
setPropertiesin interfaceCommonQueryContract- Specified by:
setPropertiesin interfaceSelectionQuery<R>- Specified by:
setPropertiesin interfaceSqmQuery- Specified by:
setPropertiesin interfaceSqmSelectionQuery<R>- Parameters:
bean- aMapof names to arguments- Returns:
this, for method chaining
-
setHibernateFlushMode
public SqmSelectionQueryImplementor<R> setHibernateFlushMode(FlushMode flushMode)
Description copied from interface:CommonQueryContractSet the currentFlushModein effect for this query.- Specified by:
setHibernateFlushModein interfaceCommonQueryContract- Specified by:
setHibernateFlushModein interfaceSelectionQuery<R>- Specified by:
setHibernateFlushModein interfaceSqmQuery- Specified by:
setHibernateFlushModein interfaceSqmSelectionQuery<R>- See Also:
CommonQueryContract.getHibernateFlushMode(),Session.getHibernateFlushMode()
-
setCacheMode
public SqmSelectionQueryImplementor<R> setCacheMode(CacheMode cacheMode)
Description copied from interface:SelectionQuerySet the currentCacheModein effect for this query.- Specified by:
setCacheModein interfaceSelectionQuery<R>- Specified by:
setCacheModein interfaceSqmSelectionQuery<R>- See Also:
SelectionQuery.getCacheMode(),Session.setCacheMode(CacheMode)
-
setCacheable
public SqmSelectionQueryImplementor<R> setCacheable(boolean cacheable)
Description copied from interface:SelectionQueryEnable/disable second level query (result) caching for this query.- Specified by:
setCacheablein interfaceSelectionQuery<R>- Specified by:
setCacheablein interfaceSqmSelectionQuery<R>- See Also:
SelectionQuery.isCacheable()
-
setCacheRegion
public SqmSelectionQueryImplementor<R> setCacheRegion(String cacheRegion)
Description copied from interface:SelectionQuerySet the name of the cache region where query results should be cached (assumingSelectionQuery.isCacheable()).nullindicates to use the default region.- Specified by:
setCacheRegionin interfaceSelectionQuery<R>- Specified by:
setCacheRegionin interfaceSqmSelectionQuery<R>- See Also:
SelectionQuery.getCacheRegion()
-
setTimeout
public SqmSelectionQueryImplementor<R> setTimeout(int timeout)
Description copied from interface:CommonQueryContractSet 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:
setTimeoutin interfaceCommonQueryContract- Specified by:
setTimeoutin interfaceSelectionQuery<R>- Specified by:
setTimeoutin interfaceSqmSelectionQuery<R>- Parameters:
timeout- the timeout in seconds- Returns:
this, for method chaining- See Also:
CommonQueryContract.getTimeout()
-
setFetchSize
public SqmSelectionQueryImplementor<R> setFetchSize(int fetchSize)
Description copied from interface:SelectionQuerySets a JDBC fetch size hint for the query.- Specified by:
setFetchSizein interfaceSelectionQuery<R>- Specified by:
setFetchSizein interfaceSqmSelectionQuery<R>- Parameters:
fetchSize- the fetch size hint- Returns:
this, for method chaining- See Also:
SelectionQuery.getFetchSize()
-
setReadOnly
public SqmSelectionQueryImplementor<R> setReadOnly(boolean readOnly)
Description copied from interface:SelectionQuerySet 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:
setReadOnlyin interfaceSelectionQuery<R>- Specified by:
setReadOnlyin interfaceSqmSelectionQuery<R>- Parameters:
readOnly-trueindicates that entities and proxies loaded by the query are to be put in read-only mode;falseindicates that entities and proxies loaded by the query will be put in modifiable mode- Returns:
this, for method chaining
-
executeQuery
public <T> T executeQuery(ResultsConsumer<T,R> resultsConsumer)
- Specified by:
executeQueryin interfaceSqmSelectionQueryImplementor<R>
-
-