public class StageQueryImpl<R> extends Object implements Stage.Query<R>
Stage.Query
.Constructor and Description |
---|
StageQueryImpl(ReactiveQuery<R> delegate) |
Modifier and Type | Method and Description |
---|---|
CompletionStage<Integer> | executeUpdate() Asynchronously execute this delete, update, or insert query, returning the updated row count. |
CacheMode | getCacheMode() Obtain the CacheMode in effect for this query. |
String | getCacheRegion() |
int | getFirstResult() |
FlushMode | getFlushMode() Obtain the FlushMode in effect for this query. |
int | getMaxResults() |
CompletionStage<List<R>> | getResultList() Asynchronously execute this query, returning the query results as a List , via a CompletionStage . |
CompletionStage<R> | getSingleResult() Asynchronously Execute this query, returning a single row that matches the query, or null if the query returns no results, throwing an exception if the query returns more than one matching row. |
boolean | isCacheable() |
boolean | isReadOnly() |
Stage.Query<R> | setCacheable(boolean cacheable) Enable or disable caching of this query result set in the second-level query cache. |
Stage.Query<R> | setCacheMode(CacheMode cacheMode) Set the current CacheMode in effect while this query is being executed. |
Stage.Query<R> | setCacheRegion(String cacheRegion) Set the name of the cache region in which to store this query result set if caching is enabled . |
Stage.Query<R> | setComment(String comment) Set the comment for this query. |
Stage.Query<R> | setFirstResult(int firstResult) Set the position of the first result that may be returned by this query when executed, where the results are numbered from 0. |
Stage.Query<R> | setFlushMode(FlushMode flushMode) Set the current FlushMode in effect while this query is being executed. |
Stage.Query<R> | setLockMode(LockMode lockMode) Set the LockMode to use for the whole query. |
Stage.Query<R> | setLockMode(String alias, LockMode lockMode) Set the LockMode to use for specified alias (as defined in the query's from clause). |
Stage.Query<R> | setLockOptions(LockOptions lockOptions) |
Stage.Query<R> | setMaxResults(int maxResults) Set the maximum number of results that may be returned by this query when executed. |
<T> Stage.Query<R> | setParameter(<any> parameter, T value) Set the value of a typed parameter. |
Stage.Query<R> | setParameter(int position, Object value) Set the value of a positional parameter. |
Stage.Query<R> | setParameter(String name, Object value) Set the value of a named parameter. |
Stage.Query<R> | setReadOnly(boolean readOnly) Set the read-only/modifiable mode for entities and proxies loaded by this Query. |
public StageQueryImpl(ReactiveQuery<R> delegate)
public Stage.Query<R> setParameter(int position, Object value)
Stage.Query
?1
, ?2
, etc.setParameter
in interface Stage.Query<R>
public Stage.Query<R> setParameter(String name, Object value)
Stage.Query
:name
.setParameter
in interface Stage.Query<R>
public <T> Stage.Query<R> setParameter(<any> parameter, T value)
Stage.Query
CriteriaBuilder
, which may itself be obtained by calling Stage.SessionFactory.getCriteriaBuilder()
.setParameter
in interface Stage.Query<R>
CriteriaBuilder#parameter(Class)
public Stage.Query<R> setMaxResults(int maxResults)
Stage.Query
setMaxResults
in interface Stage.Query<R>
public int getMaxResults()
getMaxResults
in interface Stage.Query<R>
Integer.MAX_VALUE
if not setpublic Stage.Query<R> setFirstResult(int firstResult)
Stage.Query
setFirstResult
in interface Stage.Query<R>
public int getFirstResult()
getFirstResult
in interface Stage.Query<R>
public Stage.Query<R> setReadOnly(boolean readOnly)
Stage.Query
setReadOnly
in interface Stage.Query<R>
Stage.Session.setDefaultReadOnly(boolean)
public boolean isReadOnly()
isReadOnly
in interface Stage.Query<R>
Stage.Session.isDefaultReadOnly()
public Stage.Query<R> setComment(String comment)
Stage.Query
setComment
in interface Stage.Query<R>
comment
- The human-readable commentpublic Stage.Query<R> setCacheable(boolean cacheable)
Stage.Query
setCacheable
in interface Stage.Query<R>
cacheable
- true
if this query is cacheablepublic boolean isCacheable()
isCacheable
in interface Stage.Query<R>
true
if this query is cacheableStage.Query.setCacheable(boolean)
public Stage.Query<R> setCacheRegion(String cacheRegion)
Stage.Query
caching is enabled
.setCacheRegion
in interface Stage.Query<R>
cacheRegion
- the name of the cache regionpublic String getCacheRegion()
getCacheRegion
in interface Stage.Query<R>
Stage.Query.setCacheRegion(String)
public Stage.Query<R> setLockMode(LockMode lockMode)
Stage.Query
LockMode
to use for the whole query.setLockMode
in interface Stage.Query<R>
public Stage.Query<R> setLockOptions(LockOptions lockOptions)
public Stage.Query<R> setLockMode(String alias, LockMode lockMode)
Stage.Query
LockMode
to use for specified alias (as defined in the query's from
clause).setLockMode
in interface Stage.Query<R>
alias
- the from clause aliaslockMode
- the requested LockMode
org.hibernate.query.Query#setLockMode(String,LockMode)
public Stage.Query<R> setCacheMode(CacheMode cacheMode)
Stage.Query
CacheMode
in effect while this query is being executed.setCacheMode
in interface Stage.Query<R>
public CacheMode getCacheMode()
Stage.Query
CacheMode
in effect for this query. By default, the query inherits the CacheMode
of the Stage.Session
from which is originates.getCacheMode
in interface Stage.Query<R>
Stage.Session.getCacheMode()
public Stage.Query<R> setFlushMode(FlushMode flushMode)
Stage.Query
FlushMode
in effect while this query is being executed.setFlushMode
in interface Stage.Query<R>
public FlushMode getFlushMode()
Stage.Query
FlushMode
in effect for this query. By default, the query inherits the FlushMode
of the Stage.Session
from which is originates.getFlushMode
in interface Stage.Query<R>
Stage.Session.getFlushMode()
public CompletionStage<Integer> executeUpdate()
Stage.Query
executeUpdate
in interface Stage.Query<R>
javax.persistence.Query#executeUpdate()
public CompletionStage<R> getSingleResult()
Stage.Query
null
if the query returns no results, throwing an exception if the query returns more than one matching row. If the query has multiple results per row, the results are returned in an instance of Object[]
.getSingleResult
in interface Stage.Query<R>
null
javax.persistence.Query#getSingleResult()
public CompletionStage<List<R>> getResultList()
Stage.Query
List
, via a CompletionStage
. If the query has multiple results per row, the results are returned in an instance of Object[]
.getResultList
in interface Stage.Query<R>
List
javax.persistence.Query#getResultList()